public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.15.y] Bluetooth: hci_event: Align BR/EDR JUST_WORKS paring with LE
@ 2025-03-24  7:41 bin.lan.cn
  2025-03-25 11:33 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: bin.lan.cn @ 2025-03-24  7:41 UTC (permalink / raw)
  To: gregkh, stable; +Cc: luiz.von.dentz, kiran.k, bin.lan.cn

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

[ Upstream commit b25e11f978b63cb7857890edb3a698599cddb10e ]

This aligned BR/EDR JUST_WORKS method with LE which since 92516cd97fd4
("Bluetooth: Always request for user confirmation for Just Works")
always request user confirmation with confirm_hint set since the
likes of bluetoothd have dedicated policy around JUST_WORKS method
(e.g. main.conf:JustWorksRepairing).

CVE: CVE-2024-8805
Cc: stable@vger.kernel.org
Fixes: ba15a58b179e ("Bluetooth: Fix SSP acceptor just-works confirmation without MITM")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
Build test passed.
---
 net/bluetooth/hci_event.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 50e21f67a73d..83af50c3838a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4859,19 +4859,16 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev,
 		goto unlock;
 	}
 
-	/* If no side requires MITM protection; auto-accept */
+	/* If no side requires MITM protection; use JUST_CFM method */
 	if ((!loc_mitm || conn->remote_cap == HCI_IO_NO_INPUT_OUTPUT) &&
 	    (!rem_mitm || conn->io_capability == HCI_IO_NO_INPUT_OUTPUT)) {
 
-		/* If we're not the initiators request authorization to
-		 * proceed from user space (mgmt_user_confirm with
-		 * confirm_hint set to 1). The exception is if neither
-		 * side had MITM or if the local IO capability is
-		 * NoInputNoOutput, in which case we do auto-accept
+		/* If we're not the initiator of request authorization and the
+		 * local IO capability is not NoInputNoOutput, use JUST_WORKS
+		 * method (mgmt_user_confirm with confirm_hint set to 1).
 		 */
 		if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) &&
-		    conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
-		    (loc_mitm || rem_mitm)) {
+		    conn->io_capability != HCI_IO_NO_INPUT_OUTPUT) {
 			BT_DBG("Confirming auto-accept as acceptor");
 			confirm_hint = 1;
 			goto confirm;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.15.y] Bluetooth: hci_event: Align BR/EDR JUST_WORKS paring with LE
  2025-03-24  7:41 [PATCH 5.15.y] Bluetooth: hci_event: Align BR/EDR JUST_WORKS paring with LE bin.lan.cn
@ 2025-03-25 11:33 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2025-03-25 11:33 UTC (permalink / raw)
  To: stable; +Cc: bin.lan.cn, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: b25e11f978b63cb7857890edb3a698599cddb10e

WARNING: Author mismatch between patch and upstream commit:
Backport author: bin.lan.cn@windriver.com
Commit author: Luiz Augusto von Dentz<luiz.von.dentz@intel.com>

Status in newer kernel trees:
6.13.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: 830c03e58beb)
6.1.y | Present (different SHA1: d17c631ba04e)

Note: The patch differs from the upstream commit:
---
1:  b25e11f978b63 ! 1:  5094cffc5d0c1 Bluetooth: hci_event: Align BR/EDR JUST_WORKS paring with LE
    @@ Metadata
      ## Commit message ##
         Bluetooth: hci_event: Align BR/EDR JUST_WORKS paring with LE
     
    +    [ Upstream commit b25e11f978b63cb7857890edb3a698599cddb10e ]
    +
         This aligned BR/EDR JUST_WORKS method with LE which since 92516cd97fd4
         ("Bluetooth: Always request for user confirmation for Just Works")
         always request user confirmation with confirm_hint set since the
    @@ Commit message
         Fixes: ba15a58b179e ("Bluetooth: Fix SSP acceptor just-works confirmation without MITM")
         Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
         Tested-by: Kiran K <kiran.k@intel.com>
    +    Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
    +    Signed-off-by: He Zhe <zhe.he@windriver.com>
     
      ## net/bluetooth/hci_event.c ##
    -@@ net/bluetooth/hci_event.c: static void hci_user_confirm_request_evt(struct hci_dev *hdev, void *data,
    +@@ net/bluetooth/hci_event.c: static void hci_user_confirm_request_evt(struct hci_dev *hdev,
      		goto unlock;
      	}
      
    @@ net/bluetooth/hci_event.c: static void hci_user_confirm_request_evt(struct hci_d
     -		    conn->io_capability != HCI_IO_NO_INPUT_OUTPUT &&
     -		    (loc_mitm || rem_mitm)) {
     +		    conn->io_capability != HCI_IO_NO_INPUT_OUTPUT) {
    - 			bt_dev_dbg(hdev, "Confirming auto-accept as acceptor");
    + 			BT_DBG("Confirming auto-accept as acceptor");
      			confirm_hint = 1;
      			goto confirm;
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-25 11:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24  7:41 [PATCH 5.15.y] Bluetooth: hci_event: Align BR/EDR JUST_WORKS paring with LE bin.lan.cn
2025-03-25 11:33 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox