Commit 6a5ad25
committed
Bluetooth: ISO: Fix possible circular locking dependency
This attempts to fix the following trace:
kworker/u3:1/184 is trying to acquire lock:
ffff888001888130 (sk_lock-AF_BLUETOOTH-BTPROTO_ISO){+.+.}-{0:0}, at:
iso_connect_cfm+0x2de/0x690
but task is already holding lock:
ffff8880028d1c20 (&conn->lock){+.+.}-{2:2}, at:
iso_connect_cfm+0x265/0x690
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&conn->lock){+.+.}-{2:2}:
lock_acquire+0x176/0x3d0
_raw_spin_lock+0x2a/0x40
__iso_sock_close+0x1dd/0x4f0
iso_sock_release+0xa0/0x1b0
sock_close+0x5e/0x120
__fput+0x102/0x410
task_work_run+0xf1/0x160
exit_to_user_mode_prepare+0x170/0x180
syscall_exit_to_user_mode+0x19/0x50
do_syscall_64+0x4e/0x90
entry_SYSCALL_64_after_hwframe+0x62/0xcc
-> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_ISO){+.+.}-{0:0}:
check_prev_add+0xfc/0x1190
__lock_acquire+0x1e27/0x2750
lock_acquire+0x176/0x3d0
lock_sock_nested+0x32/0x80
iso_connect_cfm+0x2de/0x690
hci_cc_le_setup_iso_path+0x195/0x340
hci_cmd_complete_evt+0x1ae/0x500
hci_event_packet+0x38e/0x7c0
hci_rx_work+0x34c/0x980
process_one_work+0x5a5/0x9a0
worker_thread+0x89/0x6f0
kthread+0x14e/0x180
ret_from_fork+0x22/0x30
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&conn->lock);
lock(sk_lock-AF_BLUETOOTH-BTPROTO_ISO);
lock(&conn->lock);
lock(sk_lock-AF_BLUETOOTH-BTPROTO_ISO);
*** DEADLOCK ***
Fixes: ccf74f2 ("Bluetooth: Add BTPROTO_ISO socket type")
Fixes: f764a6c ("Bluetooth: ISO: Add broadcast support")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>1 parent 1ed8b37 commit 6a5ad25
1 file changed
+26
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
292 | 296 | | |
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
| |||
372 | 371 | | |
373 | 372 | | |
374 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
375 | 378 | | |
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
379 | 382 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | 383 | | |
385 | 384 | | |
386 | 385 | | |
| |||
392 | 391 | | |
393 | 392 | | |
394 | 393 | | |
395 | | - | |
396 | 394 | | |
397 | 395 | | |
398 | 396 | | |
| |||
1432 | 1430 | | |
1433 | 1431 | | |
1434 | 1432 | | |
| 1433 | + | |
1435 | 1434 | | |
1436 | 1435 | | |
1437 | 1436 | | |
1438 | 1437 | | |
1439 | 1438 | | |
1440 | 1439 | | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
| 1440 | + | |
| 1441 | + | |
1445 | 1442 | | |
1446 | | - | |
1447 | 1443 | | |
1448 | | - | |
| 1444 | + | |
1449 | 1445 | | |
1450 | 1446 | | |
1451 | | - | |
1452 | | - | |
| 1447 | + | |
| 1448 | + | |
1453 | 1449 | | |
1454 | 1450 | | |
1455 | | - | |
| 1451 | + | |
1456 | 1452 | | |
1457 | 1453 | | |
1458 | | - | |
1459 | | - | |
| 1454 | + | |
1460 | 1455 | | |
1461 | | - | |
1462 | 1456 | | |
1463 | 1457 | | |
1464 | 1458 | | |
1465 | 1459 | | |
1466 | 1460 | | |
1467 | 1461 | | |
1468 | 1462 | | |
1469 | | - | |
1470 | 1463 | | |
1471 | 1464 | | |
1472 | 1465 | | |
1473 | 1466 | | |
1474 | 1467 | | |
1475 | | - | |
1476 | | - | |
| 1468 | + | |
| 1469 | + | |
1477 | 1470 | | |
1478 | 1471 | | |
1479 | 1472 | | |
1480 | 1473 | | |
1481 | 1474 | | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1486 | 1479 | | |
1487 | 1480 | | |
1488 | | - | |
1489 | | - | |
| 1481 | + | |
| 1482 | + | |
1490 | 1483 | | |
1491 | | - | |
1492 | | - | |
| 1484 | + | |
| 1485 | + | |
1493 | 1486 | | |
1494 | 1487 | | |
1495 | 1488 | | |
| |||
1500 | 1493 | | |
1501 | 1494 | | |
1502 | 1495 | | |
1503 | | - | |
1504 | | - | |
1505 | 1496 | | |
1506 | 1497 | | |
1507 | 1498 | | |
| |||
0 commit comments