================================================================== BUG: KASAN: slab-use-after-free in skb_queue_empty_lockless include/linux/skbuff.h:1840 [inline] BUG: KASAN: slab-use-after-free in skb_queue_purge_reason+0x37b/0x410 net/core/skbuff.c:3877 Read of size 8 at addr ffff888107741058 by task syz.1.3373/16009 CPU: 0 PID: 16009 Comm: syz.1.3373 Not tainted 6.10.0-rc6-syzkaller-00067-g8a9c6c40432e #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 skb_queue_empty_lockless include/linux/skbuff.h:1840 [inline] skb_queue_purge_reason+0x37b/0x410 net/core/skbuff.c:3877 vhci_flush+0x40/0x50 drivers/bluetooth/hci_vhci.c:65 hci_dev_do_reset net/bluetooth/hci_core.c:625 [inline] hci_dev_reset+0x22e/0x530 net/bluetooth/hci_core.c:665 hci_sock_ioctl+0x3d2/0x880 net/bluetooth/hci_sock.c:1133 sock_do_ioctl+0x116/0x280 net/socket.c:1222 sock_ioctl+0x22e/0x6c0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __x64_sys_ioctl+0x193/0x220 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7170b75bd9 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:00007f71718e8048 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f7170d04038 RCX: 00007f7170b75bd9 RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000007 RBP: 00007f7170be4aa1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f7170d04038 R15: 00007ffc94f70748 Allocated by task 15407: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] vhci_open+0x4c/0x440 drivers/bluetooth/hci_vhci.c:636 misc_open+0x3da/0x4c0 drivers/char/misc.c:165 chrdev_open+0x26d/0x6f0 fs/char_dev.c:414 do_dentry_open+0x91f/0x15f0 fs/open.c:955 vfs_open+0x82/0x3f0 fs/open.c:1086 do_open fs/namei.c:3654 [inline] path_openat+0x21fc/0x2e50 fs/namei.c:3813 do_filp_open+0x1dc/0x430 fs/namei.c:3840 do_sys_openat2+0x17a/0x1e0 fs/open.c:1413 do_sys_open fs/open.c:1428 [inline] __do_sys_openat fs/open.c:1444 [inline] __se_sys_openat fs/open.c:1439 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1439 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15642: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x12a/0x3b0 mm/slub.c:4559 vhci_release+0xc4/0x100 drivers/bluetooth/hci_vhci.c:672 __fput+0x408/0xbb0 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa9b/0x2ba0 kernel/exit.c:874 do_group_exit+0xd3/0x2a0 kernel/exit.c:1023 get_signal+0x2616/0x2710 kernel/signal.c:2909 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:310 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x14a/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888107741000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 88 bytes inside of freed 1024-byte region [ffff888107741000, ffff888107741400) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888107747000 pfn:0x107740 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x57ff00000000240(workingset|head|node=1|zone=2|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 057ff00000000240 ffff888015442dc0 ffffea000411b610 ffffea00041d5c10 raw: ffff888107747000 000000000010000b 00000001ffffefff 0000000000000000 head: 057ff00000000240 ffff888015442dc0 ffffea000411b610 ffffea00041d5c10 head: ffff888107747000 000000000010000b 00000001ffffefff 0000000000000000 head: 057ff00000000003 ffffea00041dd001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0x352800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 5200, tgid 5200 (syz-executor), ts 59708471427, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmalloc_node_trace_noprof+0xf1/0x350 mm/slub.c:4162 kmalloc_node_noprof include/linux/slab.h:677 [inline] alloc_fair_sched_group+0x1e6/0x450 kernel/sched/fair.c:12943 sched_create_group+0x2d/0x80 kernel/sched/core.c:10378 cpu_cgroup_css_alloc kernel/sched/core.c:10541 [inline] cpu_cgroup_css_alloc+0x15/0x30 kernel/sched/core.c:10531 css_create kernel/cgroup/cgroup.c:5549 [inline] cgroup_apply_control_enable+0x4b6/0xc80 kernel/cgroup/cgroup.c:3217 cgroup_mkdir+0x39b/0x1120 kernel/cgroup/cgroup.c:5763 kernfs_iop_mkdir+0x14a/0x1d0 fs/kernfs/dir.c:1246 vfs_mkdir+0x57d/0x860 fs/namei.c:4137 do_mkdirat+0x301/0x3a0 fs/namei.c:4160 page_owner free stack trace missing Memory state around the buggy address: ffff888107740f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888107740f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888107741000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888107741080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888107741100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================