syzbot


WARNING: bad unlock balance in l2cap_bredr_sig_cmd

Status: fixed on 2023/06/26 14:47
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+7f24d2fbaf8e9c890290@syzkaller.appspotmail.com
Fix commit: 116b9c002c89 Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
First crash: 581d, last: 549d
Fix bisection: fixed by (bisect log) :
commit 116b9c002c894097adc2b8684db2d1da4229ed46
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/23 linux-5.15.y (ToT) 9d6bde853685 C [report] WARNING: bad unlock balance in l2cap_bredr_sig_cmd
2023/05/23 upstream (ToT) ae8373a5add4 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_bredr_sig_cmd bluetooth 2 582d 586d 0/28 auto-obsoleted due to no activity on 2023/08/19 00:16
linux-6.1 WARNING: bad unlock balance in l2cap_bredr_sig_cmd 2 569d 569d 0/3 auto-obsoleted due to no activity on 2023/08/23 09:10

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
5.15.112-syzkaller #0 Not tainted
-------------------------------------
kworker/u5:1/3502 is trying to release lock (&conn->chan_lock) at:
[<ffffffff8943b237>] l2cap_bredr_sig_cmd+0xb07/0x9fb0 net/bluetooth/l2cap_core.c:5748
but there are no more locks to release!

other info that might help us debug this:
2 locks held by kworker/u5:1/3502:
 #0: ffff888014190138 ((wq_completion)hci0#2){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2280
 #1: ffffc90002bdfd20 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2282

stack backtrace:
CPU: 0 PID: 3502 Comm: kworker/u5:1 Not tainted 5.15.112-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Workqueue: hci0 hci_rx_work
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_unlock_imbalance_bug+0x248/0x2b0 kernel/locking/lockdep.c:5064
 __lock_release kernel/locking/lockdep.c:5301 [inline]
 lock_release+0x596/0x9a0 kernel/locking/lockdep.c:5642
 __mutex_unlock_slowpath+0xde/0x750 kernel/locking/mutex.c:851
 l2cap_bredr_sig_cmd+0xb07/0x9fb0 net/bluetooth/l2cap_core.c:5748
 l2cap_sig_channel net/bluetooth/l2cap_core.c:6507 [inline]
 l2cap_recv_frame+0xa53/0x8870 net/bluetooth/l2cap_core.c:7786
 hci_acldata_packet net/bluetooth/hci_core.c:4967 [inline]
 hci_rx_work+0x489/0x7d0 net/bluetooth/hci_core.c:5158
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2307
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2454
 kthread+0x3f6/0x4f0 kernel/kthread.c:319

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/23 13:18 linux-5.15.y 9d6bde853685 4bce1a3e .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in l2cap_bredr_sig_cmd
2023/05/24 01:10 linux-5.15.y 9d6bde853685 4bce1a3e .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in l2cap_bredr_sig_cmd
2023/05/09 08:32 linux-5.15.y 8a7f2a5c5aa1 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in l2cap_bredr_sig_cmd
2023/05/09 08:14 linux-5.15.y 8a7f2a5c5aa1 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in l2cap_bredr_sig_cmd
2023/04/22 03:07 linux-5.15.y 3299fb36854f 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan WARNING: bad unlock balance in l2cap_bredr_sig_cmd
* Struck through repros no longer work on HEAD.