summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Cline <jcline@redhat.com>2019-05-22 19:03:56 +0000
committerJeremy Cline <jcline@redhat.com>2019-05-22 19:04:10 +0000
commit10868cd2f96f545744848175bad5bf88dda139a8 (patch)
tree2f091960d0595858053830261f303da714607bd5
parent10301b4d7774248bcc1e12cba6127b8580ed5425 (diff)
downloadkernel-10868cd2f96f545744848175bad5bf88dda139a8.tar.gz
kernel-10868cd2f96f545744848175bad5bf88dda139a8.tar.xz
kernel-10868cd2f96f545744848175bad5bf88dda139a8.zip
Fix an issue with Bluetooth 2.0 and earlier devices (rhbz 1711468)
-rw-r--r--Bluetooth-Check-key-sizes-only-when-Secure-Simple-Pa.patch44
-rw-r--r--kernel.spec5
2 files changed, 49 insertions, 0 deletions
diff --git a/Bluetooth-Check-key-sizes-only-when-Secure-Simple-Pa.patch b/Bluetooth-Check-key-sizes-only-when-Secure-Simple-Pa.patch
new file mode 100644
index 000000000..ee7a5309b
--- /dev/null
+++ b/Bluetooth-Check-key-sizes-only-when-Secure-Simple-Pa.patch
@@ -0,0 +1,44 @@
+From 7451bbd2c5c1c6512689855532ad49f26ba00cd6 Mon Sep 17 00:00:00 2001
+From: Marcel Holtmann <marcel@holtmann.org>
+Date: Wed, 22 May 2019 09:05:40 +0200
+Subject: [PATCH] Bluetooth: Check key sizes only when Secure Simple Pairing is
+ enabled
+
+The encryption is only mandatory to be enforced when both sides are using
+Secure Simple Pairing and this means the key size check makes only sense
+in that case.
+
+On legacy Bluetooth 2.0 and earlier devices like mice the encryption was
+optional and thus causing an issue if the key size check is not bound to
+using Secure Simple Pairing.
+
+Fixes: d5bb334a8e17 ("Bluetooth: Align minimum encryption key size for LE and BR/EDR connections")
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Cc: stable@vger.kernel.org
+---
+ net/bluetooth/hci_conn.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
+index 3cf0764d5793..7516cdde3373 100644
+--- a/net/bluetooth/hci_conn.c
++++ b/net/bluetooth/hci_conn.c
+@@ -1272,8 +1272,13 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
+ return 0;
+ }
+
+- if (hci_conn_ssp_enabled(conn) &&
+- !test_bit(HCI_CONN_ENCRYPT, &conn->flags))
++ /* If Secure Simple Pairing is not enabled, then legacy connection
++ * setup is used and no encryption or key sizes can be enforced.
++ */
++ if (!hci_conn_ssp_enabled(conn))
++ return 1;
++
++ if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
+ return 0;
+
+ /* The minimum encryption key size needs to be enforced by the
+--
+2.20.1
+
diff --git a/kernel.spec b/kernel.spec
index 119670b1a..fd1a8bf81 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -585,6 +585,10 @@ Patch524: net-vhost_net-fix-possible-infinite-loop.patch
# Fix wifi on various ideapad models not working (rhbz#1703338)
Patch526: 0001-platform-x86-ideapad-laptop-Remove-no_hw_rfkill_list.patch
+# rhbz 1711468
+# https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/
+Patch527: Bluetooth-Check-key-sizes-only-when-Secure-Simple-Pa.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1825,6 +1829,7 @@ fi
%changelog
* Wed May 22 2019 Jeremy Cline <jcline@redhat.com> - 5.1.4-300
- Linux v5.1.4
+- Fix an issue with Bluetooth 2.0 and earlier devices (rhbz 1711468)
* Mon May 20 2019 Laura Abbott <labbott@redhat.com> - 5.0.17-300
- Linux v5.0.17