Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1163593pxu; Fri, 16 Oct 2020 05:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXyoJbjfed/y91Ke1wd6iom0YwcoDhr/cT/Qy6Fg0xxRUEJcoJOXGom8nl+MKNvkdFRaad X-Received: by 2002:a17:906:a198:: with SMTP id s24mr3445109ejy.154.1602851900568; Fri, 16 Oct 2020 05:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602851900; cv=none; d=google.com; s=arc-20160816; b=YbQeS+duAaqfxNVuHiRS3EOGkFZIrgwM2MMZYz0h12FNE9TKyeJPZ9zEYQnSwsHl2D aIEtWanlGFK7e7Ms21X+eea0k/jccoYb9rbYgfhfgHOAaNk4BqYvQMcGV2HNbMr0BW2Y J6Ex4/V2TWEzJqGPPSswpQb1lU2N8UCGVrA/n6LljUKKmN3Ch7hHEfjn0AltJmAuHIdW LcXiBJFmCfr2l8S4BXfCac9lTSe4Q4qHb1MhPxXq83qWPCHIPaIL2hVyVl4sU9l3bqN/ XjS+vRYuEy48OaqosaEEy+TkwXSlIDM633OJq/3EcQJSxOWh49jYBgTye7ykZoFYSt6t gf1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RAHPualSJE/83jtDaCuuiZv3m4ACgD6dUAp6xs2/ypM=; b=oHtSxd0gczmK8T95jnRPJnflQiI0gykyFFFA1v1UZLfJpQO2fCGsjLnRoAQ55SOPVl XXxC4CMkz2LQCCActBV/yRwpFX1wqmwW1sZ0p83Wvz4ECTGMCNyG0bJRMsYdWGyTshib xvpCIiIRBNCy2g17Oe+qvmoDXD1bLb40i9zjl4n5Dph0r1nOv8OoWsM3FiW+EfIMzhLl Kbfb7C+7IxB7SpUFwqPEsiAqIthJAUiF2KJ3Xc0hkfKvsabtQ28ROyz4v0APrPFhDqih okUHm4TzjhL+mYlfpmFiN90zHoHQum2klNpxYFdqqTpqw01ftnGsGO2+ODtH59NzWoiS w0ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cvBeKwqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f6si1582761ejf.748.2020.10.16.05.37.49; Fri, 16 Oct 2020 05:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cvBeKwqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405285AbgJPJLZ (ORCPT + 99 others); Fri, 16 Oct 2020 05:11:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:40790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405251AbgJPJLR (ORCPT ); Fri, 16 Oct 2020 05:11:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 2CAFF20789; Fri, 16 Oct 2020 09:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839476; bh=NdKa06WsEB62szXY4H50HG9OvfqejlQ3mRTtRqW6VxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cvBeKwqhMj8c9wvEwtjPThhW3Hr9y/vHFJhvhoV3PibaFvhH2eWt+UWM/VRkx+kds yvdo/FQ/H7MGPqQJuIrmJJ+yw3WNj3Aopw5gE+GHG5PfpjQ+QLoMq7n8UJGcIT375x HpizzvzDHjjbaNEiDcn+mjWPxtV1Ile+oIiqFbfA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luiz Augusto von Dentz , Marcel Holtmann Subject: [PATCH 5.8 05/14] Bluetooth: MGMT: Fix not checking if BT_HS is enabled Date: Fri, 16 Oct 2020 11:07:50 +0200 Message-Id: <20201016090437.422158534@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.153175229@linuxfoundation.org> References: <20201016090437.153175229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luiz Augusto von Dentz commit b560a208cda0297fef6ff85bbfd58a8f0a52a543 upstream. This checks if BT_HS is enabled relecting it on MGMT_SETTING_HS instead of always reporting it as supported. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/mgmt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -766,7 +766,8 @@ static u32 get_supported_settings(struct if (lmp_ssp_capable(hdev)) { settings |= MGMT_SETTING_SSP; - settings |= MGMT_SETTING_HS; + if (IS_ENABLED(CONFIG_BT_HS)) + settings |= MGMT_SETTING_HS; } if (lmp_sc_capable(hdev)) @@ -1794,6 +1795,10 @@ static int set_hs(struct sock *sk, struc bt_dev_dbg(hdev, "sock %p", sk); + if (!IS_ENABLED(CONFIG_BT_HS)) + return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, + MGMT_STATUS_NOT_SUPPORTED); + status = mgmt_bredr_support(hdev); if (status) return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);