================================================================== BUG: KASAN: slab-use-after-free in consumer_del kernel/events/uprobes.c:772 [inline] BUG: KASAN: slab-use-after-free in __uprobe_unregister+0x210/0x260 kernel/events/uprobes.c:1087 Read of size 8 at addr ffff88802fe70238 by task syz.0.15/5885 CPU: 1 UID: 0 PID: 5885 Comm: syz.0.15 Not tainted 6.11.0-syzkaller-g2f27fce67173-dirty #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:93 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119 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 consumer_del kernel/events/uprobes.c:772 [inline] __uprobe_unregister+0x210/0x260 kernel/events/uprobes.c:1087 uprobe_unregister+0x45/0x70 kernel/events/uprobes.c:1111 bpf_uprobe_unregister+0xfb/0x1d0 kernel/trace/bpf_trace.c:3187 bpf_uprobe_multi_link_release+0x6d/0x170 kernel/trace/bpf_trace.c:3197 bpf_link_free+0x12c/0x2b0 kernel/bpf/syscall.c:3067 bpf_link_put_direct kernel/bpf/syscall.c:3107 [inline] bpf_link_release+0x5d/0x80 kernel/bpf/syscall.c:3114 __fput+0x3f6/0xb60 fs/file_table.c:431 task_work_run+0x14e/0x250 kernel/task_work.c:228 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [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+0x27b/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe35e5779f9 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:00007ffd73cf8888 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007fe35e707a80 RCX: 00007fe35e5779f9 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007fe35e707a80 R08: 0000000000000006 R09: 00007ffd73cf8b6f R10: 000000000003fdb4 R11: 0000000000000246 R12: 0000000000015339 R13: 00007ffd73cf8980 R14: 00007ffd73cf89a0 R15: ffffffffffffffff Allocated by task 5886: 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 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:4159 [inline] __kmalloc_node_noprof+0x211/0x430 mm/slub.c:4165 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 kvmalloc_array_node_noprof include/linux/slab.h:842 [inline] bpf_uprobe_multi_link_attach+0x45d/0xe40 kernel/trace/bpf_trace.c:3439 link_create kernel/bpf/syscall.c:5319 [inline] __sys_bpf+0x42bb/0x49c0 kernel/bpf/syscall.c:5780 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5815 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 5886: 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:2250 [inline] slab_free mm/slub.c:4474 [inline] kfree+0x12a/0x3b0 mm/slub.c:4595 kvfree+0x47/0x50 mm/util.c:696 bpf_uprobe_multi_link_attach+0xaf2/0xe40 kernel/trace/bpf_trace.c:3500 link_create kernel/bpf/syscall.c:5319 [inline] __sys_bpf+0x42bb/0x49c0 kernel/bpf/syscall.c:5780 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __x64_sys_bpf+0x78/0xc0 kernel/bpf/syscall.c:5815 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 The buggy address belongs to the object at ffff88802fe70200 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 56 bytes inside of freed 64-byte region [ffff88802fe70200, ffff88802fe70240) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2fe70 anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff88801ac428c0 ffffea000092b680 dead000000000005 raw: 0000000000000000 0000000080200020 00000001fdffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5427, tgid 5427 (syz-executor), ts 51310578678, free_ts 50919055793 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3446 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x4e/0xf0 mm/slub.c:2319 allocate_slab mm/slub.c:2482 [inline] new_slab+0x84/0x260 mm/slub.c:2535 ___slab_alloc+0xdac/0x1870 mm/slub.c:3721 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3811 __slab_alloc_node mm/slub.c:3864 [inline] slab_alloc_node mm/slub.c:4026 [inline] __do_kmalloc_node mm/slub.c:4158 [inline] __kmalloc_noprof+0x367/0x400 mm/slub.c:4171 kmalloc_noprof include/linux/slab.h:694 [inline] kzalloc_noprof include/linux/slab.h:816 [inline] kobject_get_path+0xd9/0x2b0 lib/kobject.c:161 kobject_uevent_env+0x289/0x1860 lib/kobject_uevent.c:545 __kobject_del+0x168/0x1f0 lib/kobject.c:601 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x327/0x5a0 lib/kobject.c:737 net_rx_queue_update_kobjects+0x478/0x5f0 net/core/net-sysfs.c:1178 netif_set_real_num_rx_queues+0x169/0x210 net/core/dev.c:2992 veth_init_queues+0x151/0x190 drivers/net/veth.c:1761 veth_newlink+0x630/0x9e0 drivers/net/veth.c:1879 page last free pid 30 tgid 30 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2619 kasan_depopulate_vmalloc_pte+0x63/0x80 mm/kasan/shadow.c:408 apply_to_pte_range mm/memory.c:2814 [inline] apply_to_pmd_range mm/memory.c:2858 [inline] apply_to_pud_range mm/memory.c:2894 [inline] apply_to_p4d_range mm/memory.c:2930 [inline] __apply_to_page_range+0x795/0xdd0 mm/memory.c:2964 kasan_release_vmalloc+0xac/0xc0 mm/kasan/shadow.c:525 purge_vmap_node+0x3ec/0x920 mm/vmalloc.c:2209 __purge_vmap_area_lazy+0x9ca/0xc10 mm/vmalloc.c:2293 drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2327 process_one_work+0x9c5/0x1b40 kernel/workqueue.c:3231 process_scheduled_works kernel/workqueue.c:3312 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3393 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88802fe70100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802fe70180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88802fe70200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88802fe70280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88802fe70300: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================