syzbot


KASAN: slab-use-after-free Read in skb_queue_purge_reason

Status: upstream: reported on 2025/06/21 08:51
Reported-by: syzbot+a2f50896f15927de15b2@syzkaller.appspotmail.com
First crash: 11d, last: 11d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in skb_queue_purge_reason bluetooth 1 553d 549d 0/29 auto-obsoleted due to no activity on 2024/03/26 16:32
upstream KASAN: slab-use-after-free Read in skb_queue_purge_reason (3) bluetooth 5 8d17h 16d 24/29 upstream: reported on 2025/06/16 09:57
upstream KASAN: slab-use-after-free Read in skb_queue_purge_reason (2) bluetooth C done 132 27d 411d 28/29 fixed on 2025/06/10 16:19

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in __lock_acquire+0xff/0x7c80 kernel/locking/lockdep.c:5005
Read of size 8 at addr ffff888141261088 by task syz.3.2529/12100

CPU: 1 PID: 12100 Comm: syz.3.2529 Not tainted 6.6.94-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xac/0x230 mm/kasan/report.c:475
 kasan_report+0x117/0x150 mm/kasan/report.c:588
 __lock_acquire+0xff/0x7c80 kernel/locking/lockdep.c:5005
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xa8/0xf0 kernel/locking/spinlock.c:162
 skb_dequeue net/core/skbuff.c:3693 [inline]
 skb_queue_purge_reason+0x36/0x1c0 net/core/skbuff.c:3734
 skb_queue_purge include/linux/skbuff.h:3203 [inline]
 vhci_flush+0x44/0x50 drivers/bluetooth/hci_vhci.c:69
 hci_dev_do_reset net/bluetooth/hci_core.c:574 [inline]
 hci_dev_reset+0x44f/0x610 net/bluetooth/hci_core.c:614
 sock_do_ioctl+0xd7/0x2f0 net/socket.c:1222
 sock_ioctl+0x623/0x7a0 net/socket.c:1341
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f36bf58e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f36bf3ff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f36bf7b5fa0 RCX: 00007f36bf58e929
RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000009
RBP: 00007f36bf610b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f36bf7b5fa0 R15: 00007ffd550a7e58
 </TASK>

Allocated by task 5768:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:600 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 vhci_open+0x57/0x360 drivers/bluetooth/hci_vhci.c:636
 misc_open+0x2f9/0x370 drivers/char/misc.c:179
 chrdev_open+0x59e/0x670 fs/char_dev.c:414
 do_dentry_open+0x8c6/0x1500 fs/open.c:929
 do_open fs/namei.c:3632 [inline]
 path_openat+0x274b/0x3190 fs/namei.c:3789
 do_filp_open+0x1c5/0x3d0 fs/namei.c:3816
 do_sys_openat2+0x12c/0x1c0 fs/open.c:1419
 do_sys_open fs/open.c:1434 [inline]
 __do_sys_openat fs/open.c:1450 [inline]
 __se_sys_openat fs/open.c:1445 [inline]
 __x64_sys_openat+0x139/0x160 fs/open.c:1445
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 5768:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1806 [inline]
 slab_free_freelist_hook+0x130/0x1b0 mm/slub.c:1832
 slab_free mm/slub.c:3816 [inline]
 __kmem_cache_free+0xba/0x1f0 mm/slub.c:3829
 vhci_release+0xbf/0xd0 drivers/bluetooth/hci_vhci.c:672
 __fput+0x234/0x970 fs/file_table.c:384
 task_work_run+0x1ce/0x250 kernel/task_work.c:239
 exit_task_work include/linux/task_work.h:43 [inline]
 do_exit+0x903/0x23c0 kernel/exit.c:874
 do_group_exit+0x21b/0x2d0 kernel/exit.c:1023
 get_signal+0x12fc/0x1400 kernel/signal.c:2902
 arch_do_signal_or_restart+0x96/0x780 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
 syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
 do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888141261000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 136 bytes inside of
 freed 1024-byte region [ffff888141261000, ffff888141261400)

The buggy address belongs to the physical page:
page:ffffea0005049800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x141260
head:ffffea0005049800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x57ff00000000840(slab|head|node=1|zone=2|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 057ff00000000840 ffff888017841dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x52000(__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 0, tgid 0 (swapper/0), ts 1864618578, free_ts 0
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 prep_new_page mm/page_alloc.c:1561 [inline]
 get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2120
 alloc_slab_page+0x5d/0x170 mm/slub.c:1876
 allocate_slab mm/slub.c:2023 [inline]
 new_slab+0x87/0x2e0 mm/slub.c:2076
 ___slab_alloc+0xc6d/0x12f0 mm/slub.c:3230
 __slab_alloc mm/slub.c:3329 [inline]
 __slab_alloc_node mm/slub.c:3382 [inline]
 slab_alloc_node mm/slub.c:3475 [inline]
 __kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3524
 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098
 kmalloc include/linux/slab.h:600 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 kernfs_create_root+0x5e/0x690 fs/kernfs/dir.c:967
 cgroup_setup_root+0x26e/0xb30 kernel/cgroup/cgroup.c:2074
 cgroup_init+0x19f/0xc50 kernel/cgroup/cgroup.c:6091
 start_kernel+0x440/0x4e0 init/main.c:1065
 x86_64_start_reservations+0x2a/0x30 arch/x86/kernel/head64.c:555
 copy_bootdata+0x0/0xe0 arch/x86/kernel/head64.c:536
 secondary_startup_64_no_verify+0x179/0x17b
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888141260f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888141261000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888141261080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888141261100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888141261180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/21 08:50 linux-6.6.y 6282921b6825 d6cdfb8a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in skb_queue_purge_reason
* Struck through repros no longer work on HEAD.