]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 07:34:04 +0000 (09:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2024 07:34:04 +0000 (09:34 +0200)
added patches:
bluetooth-mgmt-add-error-handling-to-pair_device.patch

queue-4.19/bluetooth-mgmt-add-error-handling-to-pair_device.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/bluetooth-mgmt-add-error-handling-to-pair_device.patch b/queue-4.19/bluetooth-mgmt-add-error-handling-to-pair_device.patch
new file mode 100644 (file)
index 0000000..9106b81
--- /dev/null
@@ -0,0 +1,37 @@
+From 538fd3921afac97158d4177139a0ad39f056dbb2 Mon Sep 17 00:00:00 2001
+From: Griffin Kroah-Hartman <griffin@kroah.com>
+Date: Thu, 15 Aug 2024 13:51:00 +0200
+Subject: Bluetooth: MGMT: Add error handling to pair_device()
+
+From: Griffin Kroah-Hartman <griffin@kroah.com>
+
+commit 538fd3921afac97158d4177139a0ad39f056dbb2 upstream.
+
+hci_conn_params_add() never checks for a NULL value and could lead to a NULL
+pointer dereference causing a crash.
+
+Fixed by adding error handling in the function.
+
+Cc: Stable <stable@kernel.org>
+Fixes: 5157b8a503fa ("Bluetooth: Fix initializing conn_params in scan phase")
+Signed-off-by: Griffin Kroah-Hartman <griffin@kroah.com>
+Reported-by: Yiwei Zhang <zhan4630@purdue.edu>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/bluetooth/mgmt.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/net/bluetooth/mgmt.c
++++ b/net/bluetooth/mgmt.c
+@@ -2913,6 +2913,10 @@ static int pair_device(struct sock *sk,
+                * will be kept and this function does nothing.
+                */
+               p = hci_conn_params_add(hdev, &cp->addr.bdaddr, addr_type);
++              if (!p) {
++                      err = -EIO;
++                      goto unlock;
++              }
+               if (p->auto_connect == HCI_AUTO_CONN_EXPLICIT)
+                       p->auto_connect = HCI_AUTO_CONN_DISABLED;
index de5b629f794351c187b25d21141371b4638a3fc7..ed60044859f729f2aac2078f48d9553bc5f3d970 100644 (file)
@@ -61,3 +61,4 @@ net-xilinx-axienet-always-disable-promiscuous-mode.patch
 drm-msm-use-drm_debug_enabled-to-check-for-debug-cat.patch
 drm-msm-dpu-don-t-play-tricks-with-debug-macros.patch
 mmc-mmc_test-fix-null-dereference-on-allocation-fail.patch
+bluetooth-mgmt-add-error-handling-to-pair_device.patch