================================================================== BUG: KASAN: slab-use-after-free in skb_queue_empty_lockless include/linux/skbuff.h:1837 [inline] BUG: KASAN: slab-use-after-free in skb_queue_purge_reason+0xb9/0x500 net/core/skbuff.c:3888 Read of size 8 at addr ffff88807fb2e858 by task syz-executor.2/13663 CPU: 0 PID: 13663 Comm: syz-executor.2 Not tainted 6.9.0-rc7-syzkaller-00132-g1164057b3c00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 skb_queue_empty_lockless include/linux/skbuff.h:1837 [inline] skb_queue_purge_reason+0xb9/0x500 net/core/skbuff.c:3888 skb_queue_purge include/linux/skbuff.h:3270 [inline] vhci_flush+0x44/0x50 drivers/bluetooth/hci_vhci.c:69 hci_dev_do_reset net/bluetooth/hci_core.c:623 [inline] hci_dev_reset+0x42a/0x5d0 net/bluetooth/hci_core.c:663 sock_do_ioctl+0x158/0x460 net/socket.c:1222 sock_ioctl+0x629/0x8e0 net/socket.c:1341 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f7ebdc7dd69 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7ebea320c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f7ebddac120 RCX: 00007f7ebdc7dd69 RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000004 RBP: 00007f7ebdcca49e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f7ebddac120 R15: 00007ffd4d3cbb68 Allocated by task 13357: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x1db/0x370 mm/slub.c:4003 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] vhci_open+0x57/0x370 drivers/bluetooth/hci_vhci.c:644 misc_open+0x313/0x390 drivers/char/misc.c:165 chrdev_open+0x5b0/0x630 fs/char_dev.c:414 do_dentry_open+0x907/0x15a0 fs/open.c:955 do_open fs/namei.c:3642 [inline] path_openat+0x2860/0x3240 fs/namei.c:3799 do_filp_open+0x235/0x490 fs/namei.c:3826 do_sys_openat2+0x13e/0x1d0 fs/open.c:1406 do_sys_open fs/open.c:1421 [inline] __do_sys_openat fs/open.c:1437 [inline] __se_sys_openat fs/open.c:1432 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1432 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 13357: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2111 [inline] slab_free mm/slub.c:4286 [inline] kfree+0x153/0x3b0 mm/slub.c:4396 vhci_release+0xbf/0xd0 drivers/bluetooth/hci_vhci.c:680 __fput+0x429/0x8a0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa1b/0x27e0 kernel/exit.c:878 do_group_exit+0x207/0x2c0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88807fb2e800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 88 bytes inside of freed 1024-byte region [ffff88807fb2e800, ffff88807fb2ec00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7fb28 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888015041dc0 ffffea0001fc9c00 dead000000000002 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 00fff00000000840 ffff888015041dc0 ffffea0001fc9c00 dead000000000002 head: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 head: 00fff00000000003 ffffea0001feca01 dead000000000122 00000000ffffffff head: 0000000800000000 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 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 34, tgid -510836874 (kworker/u8:2), ts 34, free_ts 102533077612 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2180 allocate_slab mm/slub.c:2343 [inline] new_slab+0x84/0x2f0 mm/slub.c:2396 ___slab_alloc+0xc73/0x1260 mm/slub.c:3530 __slab_alloc mm/slub.c:3615 [inline] __slab_alloc_node mm/slub.c:3668 [inline] slab_alloc_node mm/slub.c:3841 [inline] __do_kmalloc_node mm/slub.c:3971 [inline] __kmalloc_node_track_caller+0x2d6/0x4f0 mm/slub.c:3992 kmalloc_reserve+0x111/0x2a0 net/core/skbuff.c:599 pskb_expand_head+0x202/0x1390 net/core/skbuff.c:2251 __skb_cow include/linux/skbuff.h:3691 [inline] skb_cow_head include/linux/skbuff.h:3725 [inline] batadv_skb_head_push+0x164/0x200 net/batman-adv/soft-interface.c:72 batadv_send_skb_packet+0xee/0x670 net/batman-adv/send.c:86 batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:392 [inline] batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:420 [inline] batadv_iv_send_outstanding_bat_ogm_packet+0x673/0x810 net/batman-adv/bat_iv_ogm.c:1700 process_one_work kernel/workqueue.c:3267 [inline] process_scheduled_works+0xa10/0x17c0 kernel/workqueue.c:3348 worker_thread+0x86d/0xd70 kernel/workqueue.c:3429 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 page last free pid 5099 tgid 5099 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x986/0xab0 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 discard_slab mm/slub.c:2442 [inline] __put_partials+0xeb/0x130 mm/slub.c:2911 put_cpu_partial+0x17c/0x250 mm/slub.c:2986 __slab_free+0x2ea/0x3d0 mm/slub.c:4157 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3804 [inline] slab_alloc_node mm/slub.c:3851 [inline] kmem_cache_alloc+0x174/0x350 mm/slub.c:3858 vma_lock_alloc kernel/fork.c:441 [inline] vm_area_dup+0x61/0x290 kernel/fork.c:494 dup_mmap kernel/fork.c:697 [inline] dup_mm kernel/fork.c:1688 [inline] copy_mm+0xd7f/0x2180 kernel/fork.c:1737 copy_process+0x187a/0x3df0 kernel/fork.c:2390 kernel_clone+0x226/0x8f0 kernel/fork.c:2797 __do_sys_clone kernel/fork.c:2940 [inline] __se_sys_clone kernel/fork.c:2924 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2924 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88807fb2e700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807fb2e780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807fb2e800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807fb2e880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807fb2e900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================