mbox series

[v2,0/2] Bluetooth: iso: Fix circular lock warnings

Message ID 20241209094218.4939-1-iulia.tanasescu@nxp.com (mailing list archive)
Headers show
Series Bluetooth: iso: Fix circular lock warnings | expand

Message

Iulia Tanasescu Dec. 9, 2024, 9:42 a.m. UTC
This patch fixes the circular locking dependency warnings in iso.c,
caused by A->B/B->A type lock ordering with sk and hdev.

The first commit fixes the warning caused by iso_listen_bis, by
releasing sk lock before entering the function and acquiring hdev
lock.

The second commit fixes the warning caused by iso_conn_big_sync.
This reworks iso_sock_recvmsg, since it contains multiple function
calls that need sk lock to be released: The socket needs to be kept
alive with sock_hold before being released. To avoid multiple
hold/release/lock/put calls, the socket is grabbed and locked at the
beginning of the switch, and it is released and ungrabbed at the end,
with release/lock calls when necessary in the switch.

Iulia Tanasescu (2):
  Bluetooth: iso: Fix circular lock in iso_listen_bis
  Bluetooth: iso: Fix circular lock in iso_conn_big_sync

 net/bluetooth/iso.c | 48 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 39 insertions(+), 9 deletions(-)


base-commit: 269f7b219173ffbb01121243c55cef8a5503593b

Comments

patchwork-bot+bluetooth@kernel.org Dec. 11, 2024, 4:50 p.m. UTC | #1
Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon,  9 Dec 2024 11:42:16 +0200 you wrote:
> This patch fixes the circular locking dependency warnings in iso.c,
> caused by A->B/B->A type lock ordering with sk and hdev.
> 
> The first commit fixes the warning caused by iso_listen_bis, by
> releasing sk lock before entering the function and acquiring hdev
> lock.
> 
> [...]

Here is the summary with links:
  - [v2,1/2] Bluetooth: iso: Fix circular lock in iso_listen_bis
    https://git.kernel.org/bluetooth/bluetooth-next/c/c9f33b7cbdb3
  - [v2,2/2] Bluetooth: iso: Fix circular lock in iso_conn_big_sync
    https://git.kernel.org/bluetooth/bluetooth-next/c/ea4f8778d364

You are awesome, thank you!