Bluetooth: hci_core: fix list_for_each_entry_rcu usage
authorPauli Virtanen <pav@iki.fi>
Sat, 31 May 2025 15:24:58 +0000 (18:24 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 5 Jun 2025 18:53:13 +0000 (14:53 -0400)
commit308a3a8ce8ea41b26c46169f3263e50f5997c28e
treef28f7363f429977f3457b9badee5a562d020ca2f
parent3cae906e1a6184cdc9e4d260e4dbdf9a118d94ad
Bluetooth: hci_core: fix list_for_each_entry_rcu usage

Releasing + re-acquiring RCU lock inside list_for_each_entry_rcu() loop
body is not correct.

Fix by taking the update-side hdev->lock instead.

Fixes: c7eaf80bfb0c ("Bluetooth: Fix hci_link_tx_to RCU lock usage")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c