syzbot


WARNING: bad unlock balance in l2cap_recv_frame

Status: fixed on 2023/06/08 14:41
Subsystems: bluetooth
[Documentation on labels]
Reported-by: syzbot+9519d6b5b79cf7787cf3@syzkaller.appspotmail.com
Fix commit: 25e97f7b1866 Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
First crash: 381d, last: 366d
Discussions (10)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 4.14 13/13] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:52
[PATCH AUTOSEL 4.19 13/13] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:51
[PATCH AUTOSEL 5.4 18/18] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:50
[PATCH AUTOSEL 5.10 24/24] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:49
[PATCH AUTOSEL 5.15 30/30] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:48
[PATCH AUTOSEL 6.1 48/49] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:46
[PATCH AUTOSEL 6.2 52/53] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:44
[PATCH AUTOSEL 6.3 58/59] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 1 (1) 2023/05/04 19:41
[PATCH] Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp 2 (2) 2023/04/17 18:30
[syzbot] [bluetooth?] WARNING: bad unlock balance in l2cap_recv_frame 1 (2) 2023/04/17 05:34
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 WARNING: bad unlock balance in l2cap_recv_frame origin:lts-only C done 22 341d 372d 3/3 fixed on 2023/06/26 14:47
linux-5.15 WARNING: bad unlock balance in l2cap_recv_frame origin:lts-only C done 5 339d 362d 3/3 fixed on 2023/06/26 14:47

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
6.3.0-syzkaller-04626-g0cfd8703e7da #0 Not tainted
-------------------------------------
kworker/u5:2/5022 is trying to release lock (&conn->chan_lock) at:
[<ffffffff8915e1a8>] l2cap_disconnect_rsp net/bluetooth/l2cap_core.c:4697 [inline]
[<ffffffff8915e1a8>] l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5748 [inline]
[<ffffffff8915e1a8>] l2cap_sig_channel net/bluetooth/l2cap_core.c:6507 [inline]
[<ffffffff8915e1a8>] l2cap_recv_frame+0x4ad8/0x9390 net/bluetooth/l2cap_core.c:7786
but there are no more locks to release!

other info that might help us debug this:
2 locks held by kworker/u5:2/5022:
 #0: ffff888146f5e938 ((wq_completion)hci1#2){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888146f5e938 ((wq_completion)hci1#2){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff888146f5e938 ((wq_completion)hci1#2){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff888146f5e938 ((wq_completion)hci1#2){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:639 [inline]
 #0: ffff888146f5e938 ((wq_completion)hci1#2){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:666 [inline]
 #0: ffff888146f5e938 ((wq_completion)hci1#2){+.+.}-{0:0}, at: process_one_work+0x87a/0x15c0 kernel/workqueue.c:2361
 #1: ffffc90003cafda8 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x15c0 kernel/workqueue.c:2365

stack backtrace:
CPU: 0 PID: 5022 Comm: kworker/u5:2 Not tainted 6.3.0-syzkaller-04626-g0cfd8703e7da #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Workqueue: hci1 hci_rx_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 __lock_release kernel/locking/lockdep.c:5368 [inline]
 lock_release+0x4f1/0x670 kernel/locking/lockdep.c:5711
 __mutex_unlock_slowpath+0x99/0x5e0 kernel/locking/mutex.c:907
 l2cap_disconnect_rsp net/bluetooth/l2cap_core.c:4697 [inline]
 l2cap_bredr_sig_cmd net/bluetooth/l2cap_core.c:5748 [inline]
 l2cap_sig_channel net/bluetooth/l2cap_core.c:6507 [inline]
 l2cap_recv_frame+0x4ad8/0x9390 net/bluetooth/l2cap_core.c:7786
 l2cap_recv_acldata+0xa80/0xbf0 net/bluetooth/l2cap_core.c:8504
 hci_acldata_packet net/bluetooth/hci_core.c:3828 [inline]
 hci_rx_work+0x709/0x1340 net/bluetooth/hci_core.c:4063
 process_one_work+0x991/0x15c0 kernel/workqueue.c:2390
 worker_thread+0x669/0x1090 kernel/workqueue.c:2537
 kthread+0x33e/0x440 kernel/kthread.c:379
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
 </TASK>
Bluetooth: Wrong link type (-22)
Bluetooth: Wrong link type (-22)
Bluetooth: hci1: link tx timeout
Bluetooth: hci1: killing stalled connection 11:aa:aa:aa:aa:aa
Bluetooth: hci4: ACL packet for unknown connection handle 0
Bluetooth: hci4: ACL packet for unknown connection handle 0
Bluetooth: Wrong link type (-22)
Bluetooth: Wrong link type (-22)
Bluetooth: hci1: link tx timeout
Bluetooth: hci1: killing stalled connection 11:aa:aa:aa:aa:aa
Bluetooth: Wrong link type (-22)
Bluetooth: Wrong link type (-22)
Bluetooth: hci1: link tx timeout
Bluetooth: hci1: killing stalled connection 11:aa:aa:aa:aa:aa
Bluetooth: hci4: ACL packet for unknown connection handle 0
Bluetooth: Wrong link type (-22)
Bluetooth: Wrong link type (-22)
Bluetooth: Wrong link type (-22)
Bluetooth: Wrong link type (-22)
Bluetooth: hci1: link tx timeout
Bluetooth: hci1: killing stalled connection 11:aa:aa:aa:aa:aa
Bluetooth: hci1: ISO packet for unknown connection handle 2048
Bluetooth: hci1: command 0x0406 tx timeout
Bluetooth: Wrong link type (-71)
Bluetooth: Wrong link type (-71)
Bluetooth: hci2: link tx timeout
Bluetooth: hci2: killing stalled connection 10:aa:aa:aa:aa:aa
Bluetooth: Wrong link type (-71)
Bluetooth: hci2: link tx timeout
Bluetooth: hci2: killing stalled connection 10:aa:aa:aa:aa:aa
Bluetooth: Wrong link type (-71)
Bluetooth: hci2: link tx timeout
Bluetooth: hci2: killing stalled connection 10:aa:aa:aa:aa:aa

Crashes (75):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/27 00:38 upstream 0cfd8703e7da 19a3dabe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/26 10:07 upstream 4173cf6fb6b7 7560799c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/26 05:36 upstream 4173cf6fb6b7 7560799c .config console log report info ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/25 20:26 upstream 173ea743bf7a 65320f8e .config console log report info ci-upstream-kasan-gce-selinux-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/25 05:26 upstream 1a0beef98b58 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/25 01:56 upstream 1a0beef98b58 65320f8e .config console log report info ci-qemu-upstream WARNING: bad unlock balance in l2cap_recv_frame
2023/04/24 02:29 upstream 457391b03803 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/24 01:10 upstream 457391b03803 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/23 19:23 upstream 622322f53c6d 2b32bd34 .config console log report info ci-qemu-upstream WARNING: bad unlock balance in l2cap_recv_frame
2023/04/23 02:40 upstream 2caeeb9d4a1b 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/22 13:30 upstream 8e41e0a57566 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/22 11:07 upstream 8e41e0a57566 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/22 10:04 upstream 8e41e0a57566 2b32bd34 .config console log report info ci-qemu-upstream WARNING: bad unlock balance in l2cap_recv_frame
2023/04/21 13:13 upstream b7bc77e2f2c7 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/21 08:28 upstream b7bc77e2f2c7 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/21 05:39 upstream b7bc77e2f2c7 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/20 23:13 upstream cb0856346a60 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/20 14:07 upstream cb0856346a60 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/20 07:15 upstream 789b4a41c247 a219f34e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/19 21:34 upstream 789b4a41c247 a219f34e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/19 19:55 upstream 789b4a41c247 a219f34e .config console log report info ci-upstream-kasan-gce-selinux-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/19 04:50 upstream af67688dca57 d931e9f0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/18 23:53 upstream af67688dca57 d931e9f0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/18 12:06 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/18 06:44 upstream 6a8f57ae2eb0 436577a9 .config console log report info ci-qemu-upstream WARNING: bad unlock balance in l2cap_recv_frame
2023/04/18 04:59 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/17 20:13 upstream 6a8f57ae2eb0 c6ec7083 .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/17 13:01 upstream 6a8f57ae2eb0 c6ec7083 .config console log report info ci-qemu-upstream WARNING: bad unlock balance in l2cap_recv_frame
2023/04/17 12:48 upstream 6a8f57ae2eb0 c6ec7083 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/17 12:04 upstream 6a8f57ae2eb0 c6ec7083 .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/15 02:15 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/15 01:40 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 22:32 upstream 95abc817ab3a 3cfcaa1b .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 21:59 upstream 95abc817ab3a 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 21:21 upstream 95abc817ab3a 3cfcaa1b .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 20:12 upstream 95abc817ab3a 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 19:12 upstream 95abc817ab3a 3cfcaa1b .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 13:30 upstream 44149752e998 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 08:38 upstream 44149752e998 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 07:54 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 06:03 upstream 44149752e998 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 04:28 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 02:15 upstream 44149752e998 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/26 23:26 upstream 0cfd8703e7da 19a3dabe .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/25 14:38 upstream 173ea743bf7a 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/24 19:25 upstream 457391b03803 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/22 23:08 upstream 2caeeb9d4a1b 2b32bd34 .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/22 06:37 upstream 8e41e0a57566 2b32bd34 .config console log report info ci-qemu-upstream-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/20 05:23 upstream 789b4a41c247 a219f34e .config console log report info ci-qemu-upstream-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/19 14:59 upstream af67688dca57 94b4184e .config console log report info ci-qemu-upstream-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/19 01:02 upstream af67688dca57 d931e9f0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/17 19:16 upstream 6a8f57ae2eb0 c6ec7083 .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/16 02:08 upstream a7a55e27ad72 ec410564 .config console log report info ci-qemu-upstream-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/16 00:56 upstream 7a934f4bd7d6 ec410564 .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/15 18:12 upstream 7a934f4bd7d6 ec410564 .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/15 01:28 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/15 00:26 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 16:42 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 16:01 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 08:24 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 08:20 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 06:47 upstream 44149752e998 3cfcaa1b .config console log report info ci-upstream-kasan-gce-386 WARNING: bad unlock balance in l2cap_recv_frame
2023/04/16 01:39 linux-next d3f2cd248191 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/15 14:08 linux-next d3f2cd248191 ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/14 15:54 linux-next e3342532ecd3 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/11 20:57 linux-next 009795d283d1 49faf98d .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/11 13:43 linux-next 009795d283d1 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
2023/04/11 11:47 linux-next 009795d283d1 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: bad unlock balance in l2cap_recv_frame
* Struck through repros no longer work on HEAD.