syzbot


WARNING: bad unlock balance in l2cap_disconnect_rsp

Status: fixed on 2023/06/26 14:47
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+7ce948317c9c0bbfa811@syzkaller.appspotmail.com
Fix commit: fd269a0435f8 Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
First crash: 582d, last: 548d
Fix bisection: fixed by (bisect log) :
commit fd269a0435f8e9943b7a57c5a59688848d42d449
Author: Min Li <lm0963hack@gmail.com>
Date: Mon Apr 17 02:27:54 2023 +0000

  Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp

  
Bug presence (2)
Date Name Commit Repro Result
2023/05/09 linux-6.1.y (ToT) ca48fc16c493 C [report] WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/09 upstream (ToT) ba0ad6ed89fd C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: bad unlock balance in l2cap_disconnect_rsp bluetooth C 72 558d 584d 0/28 auto-obsoleted due to no activity on 2023/08/13 05:44
linux-5.15 WARNING: bad unlock balance in l2cap_disconnect_rsp origin:lts-only C error 49 550d 582d 0/3 auto-obsoleted due to no activity on 2024/10/03 18:59

Sample crash report:
Bluetooth: hci0: unexpected cc 0x0c25 length: 249 > 3
Bluetooth: hci0: unexpected cc 0x0c38 length: 249 > 2
=====================================
WARNING: bad unlock balance detected!
6.1.26-syzkaller #0 Not tainted
-------------------------------------
kworker/u5:2/4228 is trying to release lock (&conn->chan_lock) at:
[<ffff80001138a084>] l2cap_disconnect_rsp+0x210/0x30c net/bluetooth/l2cap_core.c:4697
but there are no more locks to release!

other info that might help us debug this:
2 locks held by kworker/u5:2/4228:
 #0: ffff0000d0f56138 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x664/0x1404 kernel/workqueue.c:2262
 #1: ffff80001da07c20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x6a8/0x1404 kernel/workqueue.c:2264

stack backtrace:
CPU: 1 PID: 4228 Comm: kworker/u5:2 Not tainted 6.1.26-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Workqueue: hci0 hci_rx_work
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 print_unlock_imbalance_bug+0x250/0x2a4 kernel/locking/lockdep.c:5109
 lock_release+0x4dc/0xa50 kernel/locking/lockdep.c:5689
 __mutex_unlock_slowpath+0xe0/0x6cc kernel/locking/mutex.c:907
 mutex_unlock+0x24/0x30 kernel/locking/mutex.c:543
 l2cap_disconnect_rsp+0x210/0x30c net/bluetooth/l2cap_core.c:4697
 l2cap_le_sig_cmd net/bluetooth/l2cap_core.c:6426 [inline]
 l2cap_le_sig_channel net/bluetooth/l2cap_core.c:6464 [inline]
 l2cap_recv_frame+0x18b4/0x6a14 net/bluetooth/l2cap_core.c:7796
 l2cap_recv_acldata+0x4f4/0x163c net/bluetooth/l2cap_core.c:8504
 hci_acldata_packet net/bluetooth/hci_core.c:3828 [inline]
 hci_rx_work+0x2cc/0x8b8 net/bluetooth/hci_core.c:4063
 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289
 worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
 kthread+0x250/0x2d8 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860

Crashes (37):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/30 19:30 linux-6.1.y ca1c9012c941 62df2017 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/30 15:17 linux-6.1.y ca1c9012c941 62df2017 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/29 17:31 linux-6.1.y ca1c9012c941 62df2017 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/30 20:21 linux-6.1.y ca1c9012c941 62df2017 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/24 16:02 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/19 08:25 linux-6.1.y fa74641fb6b9 3bb7af1d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/18 04:12 linux-6.1.y fa74641fb6b9 3bb7af1d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/14 14:20 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/13 14:26 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/11 11:58 linux-6.1.y ca48fc16c493 0fbd49f4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/09 17:24 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/09 12:09 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/09 00:34 linux-6.1.y ca48fc16c493 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/08 20:41 linux-6.1.y ca48fc16c493 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/08 18:27 linux-6.1.y ca48fc16c493 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/06 19:21 linux-6.1.y ca48fc16c493 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/05 09:37 linux-6.1.y ca48fc16c493 518a39a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/05/03 06:55 linux-6.1.y ca48fc16c493 48e0a81d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/28 22:39 linux-6.1.y ca1c9012c941 62df2017 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/28 11:48 linux-6.1.y ca1c9012c941 70a605de .config console log report info ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/28 08:18 linux-6.1.y ca1c9012c941 70a605de .config console log report info ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/27 17:52 linux-6.1.y ca1c9012c941 6f3d6fa7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/27 00:43 linux-6.1.y ca1c9012c941 19a3dabe .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/26 01:29 linux-6.1.y f17b0ab65d17 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/25 19:44 linux-6.1.y f17b0ab65d17 65320f8e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/24 19:16 linux-6.1.y f17b0ab65d17 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/24 17:37 linux-6.1.y f17b0ab65d17 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/24 12:16 linux-6.1.y f17b0ab65d17 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/24 00:32 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/23 20:03 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/23 12:13 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/23 12:06 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/23 00:25 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/22 22:42 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/21 22:24 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/20 20:58 linux-6.1.y f17b0ab65d17 a219f34e .config console log report info ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
2023/04/20 15:48 linux-6.1.y f17b0ab65d17 a219f34e .config console log report info ci2-linux-6-1-kasan-arm64 WARNING: bad unlock balance in l2cap_disconnect_rsp
* Struck through repros no longer work on HEAD.