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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:

--- 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;

        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





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux