================================================================== 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 ffff888000285fb8 by task syz.1.1128/9645 CPU: 2 UID: 0 PID: 9645 Comm: syz.1.1128 Not tainted 6.11.0-rc3-syzkaller-00256-g296c871d2904 #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+0x63/0x80 kernel/bpf/syscall.c:3114 __fput+0x408/0xbb0 fs/file_table.c:422 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_fast_syscall_32+0x80/0x120 arch/x86/entry/common.c:389 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf748e579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffde211c EFLAGS: 00000202 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 000000000000001e RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 9646: 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:4158 [inline] __kmalloc_node_noprof+0x211/0x440 mm/slub.c:4164 __kvmalloc_node_noprof+0x9d/0x1a0 mm/util.c:650 kvmalloc_array_node_noprof include/linux/slab.h:833 [inline] bpf_uprobe_multi_link_attach+0x45d/0xe40 kernel/trace/bpf_trace.c:3439 link_create kernel/bpf/syscall.c:5319 [inline] __sys_bpf+0x4d56/0x55e0 kernel/bpf/syscall.c:5780 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5815 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 9646: 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:2252 [inline] slab_free mm/slub.c:4473 [inline] kfree+0x12a/0x3b0 mm/slub.c:4594 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+0x4d56/0x55e0 kernel/bpf/syscall.c:5780 __do_sys_bpf kernel/bpf/syscall.c:5817 [inline] __se_sys_bpf kernel/bpf/syscall.c:5815 [inline] __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5815 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888000285f80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 56 bytes inside of freed 64-byte region [ffff888000285f80, ffff888000285fc0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888000285400 pfn:0x285 flags: 0x7ff00000000200(workingset|node=0|zone=0|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 007ff00000000200 ffff8880158428c0 ffffea00008f26d0 ffffea0000a1cb10 raw: ffff888000285400 000000000020001f 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5349, tgid 5349 (syz-executor), ts 57923640638, free_ts 56704311583 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4700 __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:2321 allocate_slab mm/slub.c:2484 [inline] new_slab+0x84/0x260 mm/slub.c:2537 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] __kmalloc_cache_noprof+0x2c5/0x310 mm/slub.c:4184 kmalloc_noprof include/linux/slab.h:681 [inline] __netdev_adjacent_dev_insert+0x20f/0xbc0 net/core/dev.c:7759 __netdev_adjacent_dev_link_lists net/core/dev.c:7856 [inline] __netdev_adjacent_dev_link_neighbour net/core/dev.c:7880 [inline] __netdev_upper_dev_link+0x414/0x850 net/core/dev.c:7940 netdev_master_upper_dev_link+0xa0/0xd0 net/core/dev.c:8015 batadv_hardif_enable_interface+0x28e/0xd20 net/batman-adv/hard-interface.c:734 batadv_softif_slave_add+0x109/0x130 net/batman-adv/soft-interface.c:844 do_set_master+0x1bc/0x230 net/core/rtnetlink.c:2701 do_setlink+0xa82/0x3ec0 net/core/rtnetlink.c:2907 __rtnl_newlink+0xc3a/0x1920 net/core/rtnetlink.c:3696 page last free pid 5370 tgid 5370 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_folios+0x9e9/0x1390 mm/page_alloc.c:2660 folios_put_refs+0x560/0x760 mm/swap.c:1039 free_pages_and_swap_cache+0x45f/0x510 mm/swap_state.c:335 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu mm/mmu_gather.c:373 [inline] tlb_finish_mmu+0x168/0x7b0 mm/mmu_gather.c:465 exit_mmap+0x3d1/0xb20 mm/mmap.c:3425 __mmput+0x12a/0x480 kernel/fork.c:1345 mmput+0x62/0x70 kernel/fork.c:1367 exit_mm kernel/exit.c:571 [inline] do_exit+0x9bf/0x2bb0 kernel/exit.c:869 do_group_exit+0xd3/0x2a0 kernel/exit.c:1031 __do_sys_exit_group kernel/exit.c:1042 [inline] __se_sys_exit_group kernel/exit.c:1040 [inline] __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1040 x64_sys_call+0x14a9/0x16a0 arch/x86/include/generated/asm/syscalls_64.h:232 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 Memory state around the buggy address: ffff888000285e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888000285f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888000285f80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888000286000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888000286080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi