diff mbox series

regression in c7f59461f5a78: Bluetooth: Fix a refcnt underflow problem for hci_conn

Message ID a3a31b2d-6039-4b50-af81-47f7ea1a0461@munic.io
State New
Headers show
Series regression in c7f59461f5a78: Bluetooth: Fix a refcnt underflow problem for hci_conn | expand

Commit Message

Andrei Volkov Jan. 22, 2024, 12:18 p.m. UTC
Hello,

Lately we've bumped with regression introduced by commit:

  c7f59461f5a78 ("Bluetooth: Fix a refcnt underflow problem for 
hci_conn", 2023-10-04)

The regression related with adding "hci_conn_ssp_enabled()" check in 
"hci_io_capa_request_evt()" handler, and broke pairing process initiated 
by the external device.

Precisely, some ext. devices, like any phone equipped with Android ver < 
14 (we have not latest one, so we didn't check), always send "IO 
Capability Request" before "Read Remote Extended Features" command, as 
consequence the flag "HCI_CONN_SSP_ENABLED" not yet activated at the 
time of "hci_io_capa_request_evt()" execution  and 
"hci_conn_ssp_enabled()" always returns false in time of the pairing.

As a result, pairing always fails. The quick and dirty fix is revert the 
ssp check introduced in the subj. commit, like below:

         hci_conn_hold(conn);


However, a more thorough and correct fix requires discussion and 
testing. Therefore, I would like to get any comments/suggestion from the 
community before doing this.

Regards
Andrey VOLKOV
diff mbox series

Patch

--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5329,7 +5329,7 @@  static void hci_io_capa_request_evt(struct hci_dev 
*hdev, void *data,
         hci_dev_lock(hdev);

         conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
-       if (!conn || !hci_conn_ssp_enabled(conn))
+       if (!conn)
                 goto unlock;