KASAN: use-after-free Read in l2cap_send_cmd

Status: upstream: reported on 2026/10/15 06:14
Reported-by: syzbot+8d2125d593e0def28b40@syzkaller.appspotmail.com
First crash: 20h49m, last: 20h49m
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in l2cap_send_cmd bluetooth 19 syz, C done 34 632d 962d 28/29 fixed on 2025/06/10 16:19
upstream KASAN: stack-out-of-bounds Read in l2cap_send_cmd bluetooth prio:high 17 syz, C 174 203d 215d 29/29 fixed on 2026/05/21 07:50

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in l2cap_build_cmd net/bluetooth/l2cap_core.c:3015 [inline]
BUG: KASAN: use-after-free in l2cap_send_cmd+0x14c/0x740 net/bluetooth/l2cap_core.c:1004
Read of size 8 at addr ffff0000d9861800 by task kworker/u5:5/4342

CPU: 1 PID: 4342 Comm: kworker/u5:5 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/23/2026
Workqueue: hci3 hci_rx_work
Call trace:
 dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
 print_address_description+0x88/0x218 mm/kasan/report.c:316
 print_report+0x50/0x68 mm/kasan/report.c:420
 kasan_report+0xa8/0xfc mm/kasan/report.c:524
 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351
 l2cap_build_cmd net/bluetooth/l2cap_core.c:3015 [inline]
 l2cap_send_cmd+0x14c/0x740 net/bluetooth/l2cap_core.c:1004
 l2cap_le_sig_channel net/bluetooth/l2cap_core.c:5749 [inline]
 l2cap_recv_frame+0x9a24/0xcf94 net/bluetooth/l2cap_core.c:7170
 l2cap_recv_acldata+0x3f0/0xe30 net/bluetooth/l2cap_core.c:7863
 hci_acldata_packet net/bluetooth/hci_core.c:3775 [inline]
 hci_rx_work+0x3dc/0xa70 net/bluetooth/hci_core.c:4011
 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
 kthread+0x254/0x2e0 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Allocated by task 4333:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:53
 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
 ____kasan_kmalloc mm/kasan/common.c:375 [inline]
 __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:384
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 kmalloc_trace+0x7c/0x94 mm/slab_common.c:1031
 kmalloc include/linux/slab.h:563 [inline]
 kzalloc include/linux/slab.h:699 [inline]
 l2cap_conn_add+0xb4/0x830 net/bluetooth/l2cap_core.c:7203
 l2cap_connect_cfm+0x124/0xedc net/bluetooth/l2cap_core.c:7596
 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1821
 le_conn_complete_evt+0xd70/0x12c8 net/bluetooth/hci_event.c:5771
 hci_le_conn_complete_evt+0x114/0x3b8 net/bluetooth/hci_event.c:5797
 hci_le_meta_evt+0x2c0/0x4a8 net/bluetooth/hci_event.c:7003
 hci_event_func net/bluetooth/hci_event.c:7311 [inline]
 hci_event_packet+0x64c/0xe60 net/bluetooth/hci_event.c:7366
 hci_rx_work+0x310/0xa70 net/bluetooth/hci_core.c:4006
 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
 kthread+0x254/0x2e0 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

Freed by task 4654:
 kasan_save_stack mm/kasan/common.c:46 [inline]
 kasan_set_track+0x4c/0x80 mm/kasan/common.c:53
 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:237
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:245
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1729 [inline]
 slab_free_freelist_hook+0x16c/0x1e8 mm/slub.c:1755
 slab_free mm/slub.c:3687 [inline]
 __kmem_cache_free+0xbc/0x21c mm/slub.c:3700
 kfree+0xd0/0x1a8 mm/slab_common.c:988
 l2cap_conn_free net/bluetooth/l2cap_core.c:1858 [inline]
 kref_put include/linux/kref.h:65 [inline]
 l2cap_conn_put net/bluetooth/l2cap_core.c:1870 [inline]
 l2cap_conn_del+0x4ac/0x564 net/bluetooth/l2cap_core.c:1850
 l2cap_connect_cfm+0x110/0xedc net/bluetooth/l2cap_core.c:7592
 hci_connect_cfm include/net/bluetooth/hci_core.h:1821 [inline]
 hci_conn_failed+0x184/0x2c0 net/bluetooth/hci_conn.c:1289
 hci_abort_conn_sync+0x8c0/0xb2c net/bluetooth/hci_sync.c:5630
 hci_disconnect_all_sync+0x1b0/0x35c net/bluetooth/hci_sync.c:5653
 hci_suspend_sync+0x458/0xdf4 net/bluetooth/hci_sync.c:6164
 hci_suspend_dev+0x14c/0x2d0 net/bluetooth/hci_core.c:2845
 hci_suspend_notifier+0xe4/0x264 net/bluetooth/hci_core.c:2422
 notifier_call_chain kernel/notifier.c:87 [inline]
 notifier_call_chain_robust+0xe0/0x288 kernel/notifier.c:122
 blocking_notifier_call_chain_robust+0x74/0xa8 kernel/notifier.c:347
 pm_notifier_call_chain_robust+0x34/0x60 kernel/power/main.c:90
 snapshot_open+0x17c/0x268 kernel/power/user.c:77
 misc_open+0x310/0x388 drivers/char/misc.c:145
 chrdev_open+0x3d0/0x51c fs/char_dev.c:414
 do_dentry_open+0x738/0xf8c fs/open.c:882
 vfs_open+0x7c/0x90 fs/open.c:1015
 do_open fs/namei.c:3677 [inline]
 path_openat+0x1fc0/0x27a0 fs/namei.c:3834
 do_filp_open+0x198/0x38c fs/namei.c:3861
 do_sys_openat2+0x134/0x3fc fs/open.c:1320
 do_sys_open fs/open.c:1336 [inline]
 __do_sys_openat fs/open.c:1352 [inline]
 __se_sys_openat fs/open.c:1347 [inline]
 __arm64_sys_openat+0x11c/0x150 fs/open.c:1347
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x12c arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

Last potentially related work creation:
 kasan_save_stack+0x40/0x70 mm/kasan/common.c:46
 __kasan_record_aux_stack+0xc0/0xdc mm/kasan/generic.c:486
 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
 insert_work+0x64/0x37c kernel/workqueue.c:1361
 __queue_work+0xd00/0x1280 kernel/workqueue.c:1520
 queue_work_on+0xc0/0x164 kernel/workqueue.c:1548
 queue_work include/linux/workqueue.h:515 [inline]
 l2cap_conn_ready net/bluetooth/l2cap_core.c:1694 [inline]
 l2cap_connect_cfm+0xc1c/0xedc net/bluetooth/l2cap_core.c:7635
 hci_connect_cfm+0x98/0x130 include/net/bluetooth/hci_core.h:1821
 le_conn_complete_evt+0xd70/0x12c8 net/bluetooth/hci_event.c:5771
 hci_le_conn_complete_evt+0x114/0x3b8 net/bluetooth/hci_event.c:5797
 hci_le_meta_evt+0x2c0/0x4a8 net/bluetooth/hci_event.c:7003
 hci_event_func net/bluetooth/hci_event.c:7311 [inline]
 hci_event_packet+0x64c/0xe60 net/bluetooth/hci_event.c:7366
 hci_rx_work+0x310/0xa70 net/bluetooth/hci_core.c:4006
 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
 kthread+0x254/0x2e0 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850

The buggy address belongs to the object at ffff0000d9861800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 0 bytes inside of
 1024-byte region [ffff0000d9861800, ffff0000d9861c00)

The buggy address belongs to the physical page:
page:00000000031fab58 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x119860
head:00000000031fab58 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002780
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000d9861700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000d9861780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000d9861800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff0000d9861880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000d9861900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
Unable to handle kernel paging request at virtual address dfff8000000000da
KASAN: null-ptr-deref in range [0x00000000000006d0-0x00000000000006d7]
Mem abort info:
  ESR = 0x0000000096000006
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x06: level 2 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000006
  CM = 0, WnR = 0
[dfff8000000000da] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 4342 Comm: kworker/u5:5 Tainted: G    B              syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/23/2026
Workqueue: hci3 hci_rx_work
pstate: 02400005 (nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--)
pc : l2cap_send_cmd+0x448/0x740 net/bluetooth/l2cap_core.c:1014
lr : l2cap_send_cmd+0x420/0x740 net/bluetooth/l2cap_core.c:1014
sp : ffff800022277390
x29: ffff8000222773c0 x28: dfff800000000000 x27: 000000000000000a
x26: ffff0000d9861800 x25: ffff0000f657b00e x24: ffff0000f657b00f
x23: 0000000000000000 x22: ffff0000c3d0ecb0 x21: 00000000000006d2
x20: ffff0000f65d7b40 x19: ffff0000c3d0f758 x18: 1fffe00033c1c97e
x17: 3d3d3d3d3d3d3d3d x16: ffff800008043a58 x15: 0000000000000002
x14: 0000000000000001 x13: 1fffe0001ecaf602 x12: 0000000000100000
x11: 00000000000290b6 x10: ffff80003240c000 x9 : ffff80001d6b7910
x8 : 00000000000000da x7 : 64206b636f6c2067 x6 : 0000000000000000
x5 : ffff0000f657b012 x4 : ffff800022277612 x3 : ffff800010e11158
x2 : 0000000000000000 x1 : 0000000000000008 x0 : 0000000000000000
Call trace:
 l2cap_send_cmd+0x448/0x740 net/bluetooth/l2cap_core.c:1014
 l2cap_le_sig_channel net/bluetooth/l2cap_core.c:5749 [inline]
 l2cap_recv_frame+0x9a24/0xcf94 net/bluetooth/l2cap_core.c:7170
 l2cap_recv_acldata+0x3f0/0xe30 net/bluetooth/l2cap_core.c:7863
 hci_acldata_packet net/bluetooth/hci_core.c:3775 [inline]
 hci_rx_work+0x3dc/0xa70 net/bluetooth/hci_core.c:4011
 process_one_work+0x7e4/0x13bc kernel/workqueue.c:2292
 worker_thread+0x8cc/0xfe8 kernel/workqueue.c:2439
 kthread+0x254/0x2e0 kernel/kthread.c:376
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:850
Code: 97c788aa f9400268 911b4915 d343fea8 (38fc6908) 
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
   0:	97c788aa 	bl	0xffffffffff1e22a8
   4:	f9400268 	ldr	x8, [x19]
   8:	911b4915 	add	x21, x8, #0x6d2
   c:	d343fea8 	lsr	x8, x21, #3
* 10:	38fc6908 	ldrsb	w8, [x8, x28] <-- trapping instruction

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/15 06:13 linux-6.1.y a500ba24937a 8fb0ae89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in l2cap_send_cmd
* Struck through repros no longer work on HEAD.