KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero

Status: upstream: reported C repro on 2026/07/20 23:56
Subsystems: bluetooth
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+e6382a2f53f5fc7453ac@syzkaller.appspotmail.com
Fix commit: Bluetooth: L2CAP: fix race l2cap_sock_cleanup_listen() vs. put_chan
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci-upstream-rust-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 27d, last: 5d10h
✨ AI Jobs (1)
ID Workflow Result Correct Bug Created Started Finished Revision
fc262eb6 assessment-security DenialOfService: ✅ Exploitable: ✅ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ✅ VMHostTrigger: ❌ KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero 2026/07/16 23:53 2026/07/16 23:53 2026/07/17 00:40 49f47391
Discussions (3)
Title Replies (including bot) Last reply
[PATCH v2] Bluetooth: L2CAP: fix race l2cap_sock_cleanup_listen() vs. put_chan 2 (2) 2026/08/11 20:10
[syzbot] [bluetooth?] KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero 1 (4) 2026/08/08 12:00
[PATCH] Bluetooth: L2CAP: fix race l2cap_sock_cleanup_listen() vs. put_chan 6 (6) 2026/08/04 16:06
Last patch testing requests (2)
Created Duration User Patch Repo Result
2026/08/08 12:00 29m pav@iki.fi patch upstream OK log
2026/07/21 04:26 29m hdanton@sina.com patch upstream OK log

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:82 [inline]
BUG: KASAN: null-ptr-deref in atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
BUG: KASAN: null-ptr-deref in refcount_read include/linux/refcount.h:170 [inline]
BUG: KASAN: null-ptr-deref in __refcount_add_not_zero include/linux/refcount.h:176 [inline]
BUG: KASAN: null-ptr-deref in __refcount_inc_not_zero include/linux/refcount.h:317 [inline]
BUG: KASAN: null-ptr-deref in refcount_inc_not_zero include/linux/refcount.h:335 [inline]
BUG: KASAN: null-ptr-deref in kref_get_unless_zero include/linux/kref.h:133 [inline]
BUG: KASAN: null-ptr-deref in l2cap_chan_hold_unless_zero+0x80/0x290 net/bluetooth/l2cap_core.c:511
Read of size 4 at addr 0000000000000008 by task syz.0.161/6387

CPU: 0 UID: 0 PID: 6387 Comm: syz.0.161 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595
 check_region_inline mm/kasan/generic.c:186 [inline]
 kasan_check_range+0x10f/0x1e0 mm/kasan/generic.c:200
 instrument_atomic_read include/linux/instrumented.h:82 [inline]
 atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
 refcount_read include/linux/refcount.h:170 [inline]
 __refcount_add_not_zero include/linux/refcount.h:176 [inline]
 __refcount_inc_not_zero include/linux/refcount.h:317 [inline]
 refcount_inc_not_zero include/linux/refcount.h:335 [inline]
 kref_get_unless_zero include/linux/kref.h:133 [inline]
 l2cap_chan_hold_unless_zero+0x80/0x290 net/bluetooth/l2cap_core.c:511
 l2cap_sock_cleanup_listen+0x8a/0x4d0 net/bluetooth/l2cap_sock.c:1535
 l2cap_sock_release+0x69/0x280 net/bluetooth/l2cap_sock.c:1480
 __sock_release+0xb3/0x260 net/socket.c:710
 sock_close+0x1c/0x30 net/socket.c:1501
 __fput+0x3ff/0xb50 fs/file_table.c:512
 task_work_run+0x150/0x240 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
 exit_to_user_mode_loop+0x1d8/0x6f0 kernel/entry/common.c:101
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:318 [inline]
 do_syscall_64+0x666/0x870 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3bf6d9e0d9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe3fe7a3b8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007f3bf7027da0 RCX: 00007f3bf6d9e0d9
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007f3bf7027da0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007f3bf7027cb0 R11: 0000000000000246 R12: 00000000000371b6
R13: 00007f3bf702609c R14: 0000000000036edd R15: 00007f3bf7026090
 </TASK>
==================================================================

Crashes (8):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/07 19:56 upstream f9a2394a2348 e4ef95d6 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/08/05 18:52 upstream c21bb4193868 1eed00d1 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/07/16 23:53 upstream e22254e9ddd8 6ca2b51a .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/07/17 03:02 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci a13c140cc289 8f30cfd7 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/07/29 09:35 net-next 2bb54b49e9d5 19622d9d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/08/07 08:17 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci db788396cbb1 c38879ea .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/08/06 08:32 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7235a3e71949 cd5b1963 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
2026/08/05 11:26 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7235a3e71949 b3eac40e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: null-ptr-deref Read in l2cap_chan_hold_unless_zero
* Struck through repros no longer work on HEAD.