From 314bd1653cf14704f832e438cc852b0316f41fda Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 26 May 2021 11:23:36 +0200 Subject: [PATCH] bluetooth patches --- ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-4.14/series | 1 + ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-4.19/series | 1 + ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-4.4/series | 1 + ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-4.9/series | 1 + ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-5.10/series | 1 + ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-5.12/series | 1 + ...-and-local-public-keys-are-identical.patch | 37 +++++++++++++++++++ queue-5.4/series | 1 + 14 files changed, 266 insertions(+) create mode 100644 queue-4.14/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch create mode 100644 queue-4.19/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch create mode 100644 queue-4.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch create mode 100644 queue-4.9/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch create mode 100644 queue-5.10/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch create mode 100644 queue-5.12/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch create mode 100644 queue-5.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-4.14/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-4.14/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..20fc8c9355d --- /dev/null +++ b/queue-4.14/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2693,6 +2693,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-4.14/series b/queue-4.14/series index 46572b7c794..757a4b46da4 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -35,3 +35,4 @@ vgacon-record-video-mode-changes-with-vt_resizex.patch vt-fix-character-height-handling-with-vt_resizex.patch tty-vt-always-invoke-vc-vc_sw-con_resize-callback.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-4.19/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-4.19/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..6d2da03729f --- /dev/null +++ b/queue-4.19/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2703,6 +2703,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-4.19/series b/queue-4.19/series index a0afb4b3c00..03ca4de6db3 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -46,3 +46,4 @@ vgacon-record-video-mode-changes-with-vt_resizex.patch vt-fix-character-height-handling-with-vt_resizex.patch tty-vt-always-invoke-vc-vc_sw-con_resize-callback.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-4.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-4.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..f63254ed56a --- /dev/null +++ b/queue-4.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2654,6 +2654,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-4.4/series b/queue-4.4/series index 98af026e52d..01680572b71 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -29,3 +29,4 @@ vgacon-record-video-mode-changes-with-vt_resizex.patch vt-fix-character-height-handling-with-vt_resizex.patch tty-vt-always-invoke-vc-vc_sw-con_resize-callback.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-4.9/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-4.9/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..a57bfda66be --- /dev/null +++ b/queue-4.9/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2636,6 +2636,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-4.9/series b/queue-4.9/series index d8a447f8790..68133b73952 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -34,3 +34,4 @@ vt-fix-character-height-handling-with-vt_resizex.patch tty-vt-always-invoke-vc-vc_sw-con_resize-callback.patch iio-tsl2583-fix-division-by-a-zero-lux_val.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-5.10/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-5.10/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..c38d1bd1c59 --- /dev/null +++ b/queue-5.10/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2733,6 +2733,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-5.10/series b/queue-5.10/series index b233e493903..b1586d348ae 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -103,3 +103,4 @@ rtc-pcf85063-fallback-to-parent-of_node.patch x86-boot-compressed-64-check-sev-encryption-in-the-32-bit-boot-path.patch nvmet-use-new-ana_log_size-instead-the-old-one.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-5.12/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-5.12/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..ecc760b20bb --- /dev/null +++ b/queue-5.12/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2732,6 +2732,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-5.12/series b/queue-5.12/series index 910a5fe7f21..a6ee471413b 100644 --- a/queue-5.12/series +++ b/queue-5.12/series @@ -124,3 +124,4 @@ rtc-pcf85063-fallback-to-parent-of_node.patch x86-boot-compressed-64-check-sev-encryption-in-the-32-bit-boot-path.patch nvmet-use-new-ana_log_size-instead-the-old-one.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch diff --git a/queue-5.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch b/queue-5.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch new file mode 100644 index 00000000000..99a8176bd20 --- /dev/null +++ b/queue-5.4/bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch @@ -0,0 +1,37 @@ +From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Wed, 10 Mar 2021 14:13:08 -0800 +Subject: Bluetooth: SMP: Fail if remote and local public keys are identical + +From: Luiz Augusto von Dentz + +commit 6d19628f539fccf899298ff02ee4c73e4bf6df3f upstream. + +This fails the pairing procedure when both remote and local non-debug +public keys are identical. + +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -2685,6 +2685,15 @@ static int smp_cmd_public_key(struct l2c + if (skb->len < sizeof(*key)) + return SMP_INVALID_PARAMS; + ++ /* Check if remote and local public keys are the same and debug key is ++ * not in use. ++ */ ++ if (!test_bit(SMP_FLAG_DEBUG_KEY, &smp->flags) && ++ !crypto_memneq(key, smp->local_pk, 64)) { ++ bt_dev_err(hdev, "Remote and local public keys are identical"); ++ return SMP_UNSPECIFIED; ++ } ++ + memcpy(smp->remote_pk, key, 64); + + if (test_bit(SMP_FLAG_REMOTE_OOB, &smp->flags)) { diff --git a/queue-5.4/series b/queue-5.4/series index 33c682778ea..6f6df2c1ba8 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -70,3 +70,4 @@ ext4-fix-error-handling-in-ext4_end_enable_verity.patch bluetooth-l2cap-fix-handling-le-modes-by-l2cap_options.patch nvmet-use-new-ana_log_size-instead-the-old-one.patch video-hgafb-correctly-handle-card-detect-failure-during-probe.patch +bluetooth-smp-fail-if-remote-and-local-public-keys-are-identical.patch -- 2.47.3