]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Bluetooth: hci_sync: extend conn_hash lookup critical sections
authorPauli Virtanen <pav@iki.fi>
Fri, 10 Jul 2026 08:23:40 +0000 (11:23 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 Jul 2026 14:08:24 +0000 (10:08 -0400)
commitd5efd6e4b8b0634af6843178fe1a7dd2b2178a3d
treeb81f07ab6d519622c1c759e5211cfde2c04261ad
parent609c5b04a28dc1b0f3af6a7bc93055135b2d2059
Bluetooth: hci_sync: extend conn_hash lookup critical sections

Using RCU-protected pointers outside the critical sections without
refcount is incorrect and may result to UAF.

Extend critical section to cover both hci_conn_hash lookup and use of
the returned conn.

Add surrounding rcu_read_lock() also when return value is not used, in
preparation for RCU lockdep requirement to hci_lookup_le_connect().

This avoids concurrent deletion of the conn before we are done
dereferencing it.

Also, make sure to hold hdev->lock when accessing hdev->accept_list.

Fixes: 6d0417e4e1cf ("Bluetooth: hci_conn: Fix not setting conn_timeout for Broadcast Receiver")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_sync.c