linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Bluetooth: ISO-related concurrency fixes
@ 2023-06-08 21:06 Pauli Virtanen
  2023-06-08 21:06 ` [PATCH 1/3] Bluetooth: hci_sync: iterate over hci_conn_params safely Pauli Virtanen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pauli Virtanen @ 2023-06-08 21:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

This series addresses some concurrency issues (NULL / GPF) in ISO
sockets or related.

These were found while testing patches that make hci_le_set_cig_params
check the validity of the configuration and return false if incorrect.
This causes dropping of hci_conn just created, which apparently makes
hitting race conditions easier.

The test setup was primitive

while true; do bluetoothctl power on; sleep 12; bluetoothctl power off; sleep 1.5; bluetoothctl power off; sleep 2.5; done;
while true; do sudo systemctl restart bluetooth; sleep 110; done
while true; do systemctl --user restart pipewire wireplumber pipewire-pulse; sleep 91; done
while true; do paplay sample.flac & sleep 2; kill %1; sleep 0.7; done

and equivalent operations manually, on VM + connect to TWS earbuds. This
eventually hit the NULL / GFP errors here, but they are hard to
reproduce aside from the first one that appears in iso-tester.

This also produces a few other types of crashes / KASAN errors, but not
addressed here.

Pauli Virtanen (3):
  Bluetooth: hci_sync: iterate over hci_conn_params safely
  Bluetooth: hci_event: call ISO disconnect callback before deleting
    conn
  Bluetooth: ISO: fix iso_conn related locking and validity issues

 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_event.c        |  6 +++
 net/bluetooth/hci_sync.c         | 81 ++++++++++++++++++++++++++++----
 net/bluetooth/iso.c              | 53 ++++++++++++---------
 4 files changed, 111 insertions(+), 30 deletions(-)

-- 
2.40.1


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

end of thread, other threads:[~2023-06-09 18:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-08 21:06 [PATCH 0/3] Bluetooth: ISO-related concurrency fixes Pauli Virtanen
2023-06-08 21:06 ` [PATCH 1/3] Bluetooth: hci_sync: iterate over hci_conn_params safely Pauli Virtanen
2023-06-08 21:33   ` Bluetooth: ISO-related concurrency fixes bluez.test.bot
2023-06-09 17:19   ` [PATCH 1/3] Bluetooth: hci_sync: iterate over hci_conn_params safely Luiz Augusto von Dentz
2023-06-09 18:20     ` Pauli Virtanen
2023-06-09 18:34       ` Luiz Augusto von Dentz
2023-06-08 21:06 ` [PATCH 2/3] Bluetooth: hci_event: call ISO disconnect callback before deleting conn Pauli Virtanen
2023-06-08 21:06 ` [PATCH 3/3] Bluetooth: ISO: fix iso_conn related locking and validity issues Pauli Virtanen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).