All of lore.kernel.org
 help / color / mirror / Atom feed
* regression in c7f59461f5a78: Bluetooth: Fix a refcnt underflow problem for hci_conn
@ 2024-01-22 12:18 Andrei Volkov
  2024-01-22 12:54 ` bluez.test.bot
  2024-01-22 14:02 ` Luiz Augusto von Dentz
  0 siblings, 2 replies; 7+ messages in thread
From: Andrei Volkov @ 2024-01-22 12:18 UTC (permalink / raw)
  To: linux-bluetooth

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


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

end of thread, other threads:[~2024-01-22 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22 12:18 regression in c7f59461f5a78: Bluetooth: Fix a refcnt underflow problem for hci_conn Andrei Volkov
2024-01-22 12:54 ` bluez.test.bot
2024-01-22 14:02 ` Luiz Augusto von Dentz
2024-01-22 14:45   ` Andrei Volkov
2024-01-22 15:10     ` Luiz Augusto von Dentz
2024-01-22 15:50       ` Andrei Volkov
2024-01-22 16:12         ` Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.