[PATCH v2 0/4] Bluetooth: fix hci_conn lookup RCU usage + holding refcounts
From: Pauli Virtanen
Date: Sun Jul 05 2026 - 18:43:28 EST
Resending parts of
https://lore.kernel.org/linux-bluetooth/cover.1762100290.git.pav@xxxxxx/
plus additional hci_conn_params usage fix.
v2:
- Take hdev->lock instead of RCU in hci_update_scan_sync() to
guard also the hdev->accept_list access.
- In unpair_device/disconnect_sync, take hdev->lock instead of RCU.
This avoids potential access to uninitialized struct device.
In __hci_conn_add() it looks like we should move
hci_conn_hash_add(hdev, conn); after hci_conn_init_sysfs(conn);
so that the pattern
conn = hci_conn_lookup(...)
if (conn)
hci_conn_get(conn)
can be done with RCU without needing hdev->lock.
But better done in separate patch series.
Pauli Virtanen (4):
Bluetooth: hci_sync: extend conn_hash lookup critical sections
Bluetooth: mgmt: fix locking in unpair_device/disconnect_sync
Bluetooth: mgmt: hold reference for hci_conn in mgmt_pending_cmds
Bluetooth: hci_sync: hold hdev->lock for hci_conn_params lookups
net/bluetooth/hci_sync.c | 62 ++++++++++++++++++++++++++++++++++++----
net/bluetooth/mgmt.c | 42 ++++++++++++++++++++++++---
2 files changed, 94 insertions(+), 10 deletions(-)
--
2.55.0