From 025ad09c9d4a9f2d2f04ad478a94cd86dff6f857 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 1 Feb 2022 17:59:07 +0100 Subject: [PATCH] 4.4-stable patches added patches: bluetooth-mgmt-fix-misplaced-bt_hs-check.patch --- ...tooth-mgmt-fix-misplaced-bt_hs-check.patch | 50 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 queue-4.4/bluetooth-mgmt-fix-misplaced-bt_hs-check.patch diff --git a/queue-4.4/bluetooth-mgmt-fix-misplaced-bt_hs-check.patch b/queue-4.4/bluetooth-mgmt-fix-misplaced-bt_hs-check.patch new file mode 100644 index 00000000000..0068a257483 --- /dev/null +++ b/queue-4.4/bluetooth-mgmt-fix-misplaced-bt_hs-check.patch @@ -0,0 +1,50 @@ +From guillaume.bertholon@ens.fr Tue Feb 1 17:58:29 2022 +From: Guillaume Bertholon +Date: Tue, 1 Feb 2022 15:24:50 +0100 +Subject: Bluetooth: MGMT: Fix misplaced BT_HS check +To: gregkh@linuxfoundation.org +Cc: guillaume.bertholon@ens.fr, stable@vger.kernel.org +Message-ID: <1643725490-5917-1-git-send-email-guillaume.bertholon@ens.fr> + +From: Guillaume Bertholon + +The upstream commit b560a208cda0 ("Bluetooth: MGMT: Fix not checking if +BT_HS is enabled") inserted a new check in the `set_hs` function. +However, its backported version in stable (commit 5abe9f99f512 +("Bluetooth: MGMT: Fix not checking if BT_HS is enabled")), +added the check in `set_link_security` instead. + +This patch restores the intent of the upstream commit by moving back the +BT_HS check to `set_hs`. + +Fixes: 5abe9f99f512 ("Bluetooth: MGMT: Fix not checking if BT_HS is enabled") +Signed-off-by: Guillaume Bertholon +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/mgmt.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/net/bluetooth/mgmt.c ++++ b/net/bluetooth/mgmt.c +@@ -2285,10 +2285,6 @@ static int set_link_security(struct sock + + BT_DBG("request for %s", hdev->name); + +- 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_LINK_SECURITY, +@@ -2438,6 +2434,10 @@ static int set_hs(struct sock *sk, struc + + BT_DBG("request for %s", hdev->name); + ++ 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); diff --git a/queue-4.4/series b/queue-4.4/series index ee119728d23..64579318cfe 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -19,3 +19,4 @@ drm-msm-fix-wrong-size-calculation.patch hwmon-lm90-reduce-maximum-conversion-rate-for-g781.patch ipv4-raw-lock-the-socket-in-raw_bind.patch ipv4-tcp-send-zero-ipid-in-synack-messages.patch +bluetooth-mgmt-fix-misplaced-bt_hs-check.patch -- 2.47.3