summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin M. Forbes <jforbes@fedoraproject.org>2020-11-12 12:55:21 -0600
committerJustin M. Forbes <jforbes@fedoraproject.org>2020-11-12 12:55:21 -0600
commitc2f3d1f5df1f96a7c353a13d9facbb651115dac3 (patch)
treea35715ccab125ed038075f65a17a51743a5cf8ef
parentefe62957347a70b02d280329de8db473fa889b81 (diff)
downloadkernel-c2f3d1f5df1f96a7c353a13d9facbb651115dac3.tar.gz
kernel-c2f3d1f5df1f96a7c353a13d9facbb651115dac3.tar.xz
kernel-c2f3d1f5df1f96a7c353a13d9facbb651115dac3.zip
Fix bluetooth disconnect issues
Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
-rw-r--r--bluetooth-fix-LL-privacy-BLE-device-fails-to-connect.patch75
-rw-r--r--kernel.spec6
2 files changed, 81 insertions, 0 deletions
diff --git a/bluetooth-fix-LL-privacy-BLE-device-fails-to-connect.patch b/bluetooth-fix-LL-privacy-BLE-device-fails-to-connect.patch
new file mode 100644
index 000000000..593af0402
--- /dev/null
+++ b/bluetooth-fix-LL-privacy-BLE-device-fails-to-connect.patch
@@ -0,0 +1,75 @@
+From MAILER-DAEMON Thu Nov 12 18:45:00 2020
+From: Sathish Narasimman <nsathish41@gmail.com>
+To: linux-bluetooth@vger.kernel.org
+Cc: chethan.tumkur.narayan@intel.com, ravishankar.srivatsa@intel.com, kiran.k@intel.com, Sathish Narasimman <sathish.narasimman@intel.com>
+Subject: [PATCH] Bluetooth: Fix: LL PRivacy BLE device fails to connect
+Date: Thu, 22 Oct 2020 13:53:04 +0530
+Message-Id: <20201022082304.31757-1-sathish.narasimman@intel.com>
+List-ID: <linux-bluetooth.vger.kernel.org>
+X-Mailing-List: linux-bluetooth@vger.kernel.org
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 7bit
+
+When adding device to white list the device is added to resolving list
+also it has to be added only when HCI_ENABLE_LL_PRIVACY flag is set.
+HCI_ENABLE_LL_PRIVACY flag has to be tested before adding/deleting devices
+to resolving list. use_ll_privacy macro is used only to check if controller
+supports LL_Privacy.
+
+https://bugzilla.kernel.org/show_bug.cgi?id=209745
+
+Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
+Reviewed-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+---
+ net/bluetooth/hci_request.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
+index 6f12bab4d2fa..610ed0817bd7 100644
+--- a/net/bluetooth/hci_request.c
++++ b/net/bluetooth/hci_request.c
+@@ -698,7 +698,8 @@ static void del_from_white_list(struct hci_request *req, bdaddr_t *bdaddr,
+ cp.bdaddr_type);
+ hci_req_add(req, HCI_OP_LE_DEL_FROM_WHITE_LIST, sizeof(cp), &cp);
+
+- if (use_ll_privacy(req->hdev)) {
++ if (use_ll_privacy(req->hdev) &&
++ hci_dev_test_flag(req->hdev, HCI_ENABLE_LL_PRIVACY)) {
+ struct smp_irk *irk;
+
+ irk = hci_find_irk_by_addr(req->hdev, bdaddr, bdaddr_type);
+@@ -732,7 +733,8 @@ static int add_to_white_list(struct hci_request *req,
+ return -1;
+
+ /* White list can not be used with RPAs */
+- if (!allow_rpa && !use_ll_privacy(hdev) &&
++ if (!allow_rpa &&
++ !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
+ hci_find_irk_by_addr(hdev, &params->addr, params->addr_type)) {
+ return -1;
+ }
+@@ -750,7 +752,8 @@ static int add_to_white_list(struct hci_request *req,
+ cp.bdaddr_type);
+ hci_req_add(req, HCI_OP_LE_ADD_TO_WHITE_LIST, sizeof(cp), &cp);
+
+- if (use_ll_privacy(hdev)) {
++ if (use_ll_privacy(hdev) &&
++ hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY)) {
+ struct smp_irk *irk;
+
+ irk = hci_find_irk_by_addr(hdev, &params->addr,
+@@ -812,7 +815,8 @@ static u8 update_white_list(struct hci_request *req)
+ }
+
+ /* White list can not be used with RPAs */
+- if (!allow_rpa && !use_ll_privacy(hdev) &&
++ if (!allow_rpa &&
++ !hci_dev_test_flag(hdev, HCI_ENABLE_LL_PRIVACY) &&
+ hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) {
+ return 0x00;
+ }
+--
+2.17.1
+
+
diff --git a/kernel.spec b/kernel.spec
index 42c797f2e..127d9225e 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -865,6 +865,9 @@ Patch130: arm64-dts-allwinner-h5-OrangePi-PC2-Fix-ethernet-node.patch
# https://patchwork.kernel.org/project/linux-arm-kernel/patch/20201023194902.368239-1-jernej.skrabec@siol.net/
Patch131: arm64-dts-allwinner-h6-Pine-H64-Fix-ethernet-node.patch
+# rhbz 1897038
+Patch132: bluetooth-fix-LL-privacy-BLE-device-fails-to-connect.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -2978,6 +2981,9 @@ fi
#
#
%changelog
+* Thu Nov 12 2020 Justin M. Forbes <jforbes@fedoraproject.org>
+- Fix bluetooth device disconnect issues. (rhbz 1897038)
+
* Tue Nov 10 15:34:54 CST 2020 Justin M. Forbes <jforbes@fedoraproject.org> - 5.9.8-100
- Linux v5.9.8
- Fixes CVE-2020-8694 (rhbz 1828580 1896525)