--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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
--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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
--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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
--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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
--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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
--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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
--- /dev/null
+From 6d19628f539fccf899298ff02ee4c73e4bf6df3f Mon Sep 17 00:00:00 2001
+From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+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 <luiz.von.dentz@intel.com>
+
+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 <luiz.von.dentz@intel.com>
+Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)) {
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