Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6804621ybi; Mon, 8 Jul 2019 08:59:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLufWFr6262grAQr/0xhHEmB81tkff7zELqWeoXR5wb3G/lEsJshdc6ycY8s6PDlOBeY6s X-Received: by 2002:a17:90a:2768:: with SMTP id o95mr26675426pje.37.1562601576962; Mon, 08 Jul 2019 08:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562601576; cv=none; d=google.com; s=arc-20160816; b=PtFZoh30mt75w/nCm/bMyBNbhiICmTKAz7ap/B9d2+3nBO36VAKT6EMJCw/5ar/gA9 fV8waMrhpG01/NQ9SYFAjehqM3nLeebYhSEPo0S/2nUNxDjq4myv+4XGB8kHwjGesWVf um5xxwLYv9ZE6UfuXNlo6NyhCt34adMpjr3FEYccOojhERGj+/ggQXiYyJ3Q5m59fajV 4HUgBy7SEcAZ0Z7svjZCNNtZtGD5+OkcmSOjFWJjeOW3Q8zF7NmYD3QgK8wG6yg3N126 seWFjdthHnX/ML0NSJvupJTA9W/DM/3Ea6aQ71V8Gouc2ifLHTmGX9HJXpnIQPLuxX37 aw1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WgbsDICFDbLiLb8jvBTed9Pnm7sFc8azinNxGKQvzws=; b=TzSP8Fi3iFhGXsRSEYi/sdcou8D0cmGOgfFuNkfbquK0otjQpxFrroopvkqC6TrBLi LoQE3Z2M7v9sp/w270QNYORf3j2Q2rIzivCxDJpkd7cWxmag1GrF9R7DWTxvRm3LxTvi yfXrjmYTLRSh7P17Tki6MxqzMxaoFG/CZ+1FHIidEXO2yitc8CK45SrGqtrg1VTPNNxb o6QsPYbAgxW4ThJoFP+6RT8JYY+6Eh1EXLhU1RkiqGv7f/KbtwrzyPZ8YbPVhQKdCrZA Tr8SSAOQFnUyzpGIQLWh/N+McVfxRsdZqEBuY9ualESZiusqvOZnKTE/2KFCMVjgzhPD 5V6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uWUyxyFs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b20si20211516pfo.108.2019.07.08.08.59.20; Mon, 08 Jul 2019 08:59:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uWUyxyFs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391190AbfGHPoB (ORCPT + 99 others); Mon, 8 Jul 2019 11:44:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:50792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388224AbfGHPXj (ORCPT ); Mon, 8 Jul 2019 11:23:39 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D1BD216C4; Mon, 8 Jul 2019 15:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599418; bh=mzbeTsKDy1cED57NDZNwyA+OUZJUbMKf/DQpwdW6/Uc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uWUyxyFs95UTI5QrGDZKo08z67PWwwM5tldkIiaQF8ZBOg1ODN1WE3951pYQ2xvzA iGF9k5g4F/Ek3TUpa4r+lYvc2A68tCczTdiXmMVxEJISmPGKf75SFqnoRYZPZvA5/g 3P+AlmmN4rpUbiF3FnK6n8l8KyeKj0pAypsMEKp4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matias Karhumaa , Marcel Holtmann , Linus Torvalds Subject: [PATCH 4.14 01/56] Bluetooth: Fix faulty expression for minimum encryption key size check Date: Mon, 8 Jul 2019 17:12:53 +0200 Message-Id: <20190708150516.876580590@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150514.376317156@linuxfoundation.org> References: <20190708150514.376317156@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matias Karhumaa commit eca94432934fe5f141d084f2e36ee2c0e614cc04 upstream. Fix minimum encryption key size check so that HCI_MIN_ENC_KEY_SIZE is also allowed as stated in the comment. This bug caused connection problems with devices having maximum encryption key size of 7 octets (56-bit). Fixes: 693cd8ce3f88 ("Bluetooth: Fix regression with minimum encryption key size alignment") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203997 Signed-off-by: Matias Karhumaa Cc: stable@vger.kernel.org Signed-off-by: Marcel Holtmann Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/l2cap_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -1352,7 +1352,7 @@ static bool l2cap_check_enc_key_size(str * actually encrypted before enforcing a key size. */ return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) || - hcon->enc_key_size > HCI_MIN_ENC_KEY_SIZE); + hcon->enc_key_size >= HCI_MIN_ENC_KEY_SIZE); } static void l2cap_do_start(struct l2cap_chan *chan)