]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:59:07 +0000 (17:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Feb 2022 16:59:07 +0000 (17:59 +0100)
added patches:
bluetooth-mgmt-fix-misplaced-bt_hs-check.patch

queue-4.4/bluetooth-mgmt-fix-misplaced-bt_hs-check.patch [new file with mode: 0644]
queue-4.4/series

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 (file)
index 0000000..0068a25
--- /dev/null
@@ -0,0 +1,50 @@
+From guillaume.bertholon@ens.fr  Tue Feb  1 17:58:29 2022
+From: Guillaume Bertholon <guillaume.bertholon@ens.fr>
+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 <guillaume.bertholon@ens.fr>
+
+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 <guillaume.bertholon@ens.fr>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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);
index ee119728d23dabfeba578f765e65df911131a560..64579318cfe87cfc0b1c94c79a14cd767add71ef 100644 (file)
@@ -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