syzbot


WARNING: locking bug in l2cap_unregister_user

Status: upstream: reported on 2025/12/25 03:40
Subsystems: bluetooth
[Documentation on labels]
Reported-by: syzbot+a97711deac466a4afeac@syzkaller.appspotmail.com
First crash: 38d, last: 7d17h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bluetooth?] WARNING: locking bug in l2cap_unregister_user 0 (1) 2025/12/25 03:40

Sample crash report:
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(!test_bit(class_idx, lock_classes_in_use))
WARNING: kernel/locking/lockdep.c:5207 at __lock_acquire+0xfd8/0x30a4 kernel/locking/lockdep.c:-1, CPU#0: khidpd_0c451010/9057
Modules linked in:
CPU: 0 UID: 0 PID: 9057 Comm: khidpd_0c451010 Not tainted syzkaller #0 PREEMPT 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 634000c5 (nZCv daIF +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : __lock_acquire+0xfd8/0x30a4 kernel/locking/lockdep.c:-1
lr : __lock_acquire+0xfd4/0x30a4 kernel/locking/lockdep.c:5207
sp : ffff8000a34b7820
x29: ffff8000a34b7900 x28: 0000000000000001 x27: ffff0000db830af8
x26: 0000000000000003 x25: ffff0000db830b18 x24: 0000000000000001
x23: 0000000000000001 x22: 0000000000000000 x21: ffff0000db830000
x20: ffff8000975d1000 x19: ffff8000931c2cc0 x18: 1fffe0003377d090
x17: ffff80008f86e000 x16: ffff800082e5e68c x15: 0000000000000001
x14: 1fffe0003377d0fa x13: 0000000000000000 x12: 0000000000000000
x11: ffff60003377d0fb x10: 0000000000ff0100 x9 : 9e19f55f647f8d00
x8 : 9e19f55f647f8d00 x7 : 4e5241575f534b43 x6 : ffff8000805761f8
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000807f1034
x2 : 0000000000000001 x1 : 0000000100000002 x0 : 0000000000000000
Call trace:
 __lock_acquire+0xfd8/0x30a4 kernel/locking/lockdep.c:-1 (P)
 lock_acquire+0x140/0x2e0 kernel/locking/lockdep.c:5868
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x5c/0x7c kernel/locking/spinlock.c:162
 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:557 [inline]
 set_task_blocked_on include/linux/sched.h:2165 [inline]
 __mutex_lock_common+0xd24/0x2678 kernel/locking/mutex.c:701
 __mutex_lock kernel/locking/mutex.c:776 [inline]
 mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:828
 l2cap_unregister_user+0x74/0x190 net/bluetooth/l2cap_core.c:1729
 hidp_session_thread+0x3d0/0x490 net/bluetooth/hidp/core.c:1304
 kthread+0x5fc/0x75c kernel/kthread.c:463
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844
irq event stamp: 226
hardirqs last  enabled at (225): [<ffff80008049eb1c>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1570 [inline]
hardirqs last  enabled at (225): [<ffff80008049eb1c>] finish_lock_switch+0xb0/0x1c0 kernel/sched/core.c:4995
hardirqs last disabled at (226): [<ffff80008afbc254>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (226): [<ffff80008afbc254>] _raw_spin_lock_irqsave+0x2c/0x7c kernel/locking/spinlock.c:162
softirqs last  enabled at (186): [<ffff8000803e1080>] softirq_handle_end kernel/softirq.c:468 [inline]
softirqs last  enabled at (186): [<ffff8000803e1080>] handle_softirqs+0xaf8/0xc88 kernel/softirq.c:650
softirqs last disabled at (27): [<ffff800080020fb4>] __do_softirq+0x14/0x20 kernel/softirq.c:656
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.h:68:9
index 8335 is out of range for type 'unsigned long[8]'
CPU: 0 UID: 0 PID: 9057 Comm: khidpd_0c451010 Tainted: G        W           syzkaller #0 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
Call trace:
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:499 (C)
 __dump_stack+0x30/0x40 lib/dump_stack.c:94
 dump_stack_lvl+0xd8/0x12c lib/dump_stack.c:120
 dump_stack+0x1c/0x28 lib/dump_stack.c:129
 ubsan_epilogue+0x14/0x48 lib/ubsan.c:233
 __ubsan_handle_out_of_bounds+0xd0/0xfc lib/ubsan.c:455
 decode_tail kernel/locking/qspinlock.h:68 [inline]
 queued_spin_lock_slowpath+0x9f0/0xae8 kernel/locking/qspinlock.c:285
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x2a8/0x2cc kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0x64/0x7c kernel/locking/spinlock.c:162
 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:557 [inline]
 set_task_blocked_on include/linux/sched.h:2165 [inline]
 __mutex_lock_common+0xd24/0x2678 kernel/locking/mutex.c:701
 __mutex_lock kernel/locking/mutex.c:776 [inline]
 mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:828
 l2cap_unregister_user+0x74/0x190 net/bluetooth/l2cap_core.c:1729
 hidp_session_thread+0x3d0/0x490 net/bluetooth/hidp/core.c:1304
 kthread+0x5fc/0x75c kernel/kthread.c:463
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844
---[ end trace ]---
Unable to handle kernel paging request at virtual address ffff80008f7d1960
KASAN: probably user-memory-access in range [0x000000047be8cb00-0x000000047be8cb07]
Mem abort info:
  ESR = 0x0000000096000047
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x07: level 3 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000047, ISS2 = 0x00000000
  CM = 0, WnR = 1, TnD = 0, TagAccess = 0
  GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000206d55000
[ffff80008f7d1960] pgd=0000000000000000, p4d=100000020f59c003, pud=100000020f59d003, pmd=100000020f5a1003, pte=0000000000000000
Internal error: Oops: 0000000096000047 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 9057 Comm: khidpd_0c451010 Tainted: G        W           syzkaller #0 PREEMPT 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025
pstate: 834000c5 (Nzcv daIF +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : queued_spin_lock_slowpath+0x858/0xae8 kernel/locking/qspinlock.c:288
lr : decode_tail kernel/locking/qspinlock.h:68 [inline]
lr : queued_spin_lock_slowpath+0x9f0/0xae8 kernel/locking/qspinlock.c:285
sp : ffff8000a34b7820
x29: ffff8000a34b78c0 x28: 1fffe0001a0a900c x27: ffff80008f7d1960
x26: ffff80008f7d1960 x25: dfff800000000000 x24: ffff700014696f08
x23: ffff00019bbfe948 x22: 1fffe0003377fd28 x21: ffff00019bbfe940
x20: ffff0000db830010 x19: ffff0000d0548060 x18: 1fffe0003377d090
x17: 363a682e6b636f6c x16: ffff800082e5e68c x15: ffff70001261fc64
x14: 1ffff0001261fc64 x13: 0000000000000004 x12: ffffffffffffffff
x11: ffff70001261fc64 x10: ffff80008f7d1940 x9 : 0000000000000002
x8 : 0000000000000000 x7 : 0000000000000001 x6 : ffff8000805761f8
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000803c861c
x2 : 0000000000000001 x1 : 0000000000000004 x0 : ffff00019bbfe948
Call trace:
 queued_spin_lock_slowpath+0x858/0xae8 kernel/locking/qspinlock.c:291 (P)
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x2a8/0x2cc kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0x64/0x7c kernel/locking/spinlock.c:162
 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:557 [inline]
 set_task_blocked_on include/linux/sched.h:2165 [inline]
 __mutex_lock_common+0xd24/0x2678 kernel/locking/mutex.c:701
 __mutex_lock kernel/locking/mutex.c:776 [inline]
 mutex_lock_nested+0x2c/0x38 kernel/locking/mutex.c:828
 l2cap_unregister_user+0x74/0x190 net/bluetooth/l2cap_core.c:1729
 hidp_session_thread+0x3d0/0x490 net/bluetooth/hidp/core.c:1304
 kthread+0x5fc/0x75c kernel/kthread.c:463
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:844
Code: aa1a03e0 974803de aa1703e0 52800081 (f9000355) 
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
   0:	aa1a03e0 	mov	x0, x26
   4:	974803de 	bl	0xfffffffffd200f7c
   8:	aa1703e0 	mov	x0, x23
   c:	52800081 	mov	w1, #0x4                   	// #4
* 10:	f9000355 	str	x21, [x26] <-- trapping instruction

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/21 08:03 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 59e4d31a0470 2494e18d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in l2cap_unregister_user
2026/01/19 08:39 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 59e4d31a0470 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in l2cap_unregister_user
2026/01/04 19:24 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f0b4cce4481 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in l2cap_unregister_user
2025/12/27 18:54 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f0b4cce4481 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in l2cap_unregister_user
2025/12/21 03:32 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8f0b4cce4481 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in l2cap_unregister_user
* Struck through repros no longer work on HEAD.