================================================================== BUG: KASAN: slab-use-after-free in consumer_del kernel/events/uprobes.c:772 [inline] BUG: KASAN: slab-use-after-free in uprobe_unregister+0x99/0x220 kernel/events/uprobes.c:1097 Read of size 8 at addr ffff8880784890c0 by task syz.0.12/5362 CPU: 1 UID: 0 PID: 5362 Comm: syz.0.12 Not tainted 6.11.0-rc3-next-20240816-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 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 consumer_del kernel/events/uprobes.c:772 [inline] uprobe_unregister+0x99/0x220 kernel/events/uprobes.c:1097 bpf_uprobe_unregister kernel/trace/bpf_trace.c:3119 [inline] bpf_uprobe_multi_link_release+0x8c/0x1b0 kernel/trace/bpf_trace.c:3127 bpf_link_free+0xf5/0x250 kernel/bpf/syscall.c:2998 bpf_link_put_direct kernel/bpf/syscall.c:3038 [inline] bpf_link_release+0x7b/0x90 kernel/bpf/syscall.c:3045 __fput+0x24b/0x890 fs/file_table.c:424 task_work_run+0x24f/0x310 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+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f48d3379e79 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:00007fff1928e268 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 0000000000011713 RCX: 00007f48d3379e79 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007fff1928e338 R08: 0000000000000001 R09: 00007fff1928e54f R10: 00007f48d3200000 R11: 0000000000000246 R12: 0000000000000032 R13: 00007fff1928e360 R14: 00007fff1928e380 R15: ffffffffffffffff Allocated by task 5363: 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:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4202 [inline] __kmalloc_node_noprof+0x22a/0x440 mm/slub.c:4208 __kvmalloc_node_noprof+0x72/0x1b0 mm/util.c:658 kvmalloc_array_node_noprof include/linux/slab.h:835 [inline] bpf_uprobe_multi_link_attach+0x43e/0xb90 kernel/trace/bpf_trace.c:3369 link_create+0x6e9/0x870 kernel/bpf/syscall.c:5236 __sys_bpf+0x4bc/0x810 kernel/bpf/syscall.c:5697 __do_sys_bpf kernel/bpf/syscall.c:5734 [inline] __se_sys_bpf kernel/bpf/syscall.c:5732 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5732 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5363: 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 mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2295 [inline] slab_free mm/slub.c:4517 [inline] kfree+0x196/0x3e0 mm/slub.c:4665 bpf_uprobe_multi_link_attach+0xa7d/0xb90 kernel/trace/bpf_trace.c:3431 link_create+0x6e9/0x870 kernel/bpf/syscall.c:5236 __sys_bpf+0x4bc/0x810 kernel/bpf/syscall.c:5697 __do_sys_bpf kernel/bpf/syscall.c:5734 [inline] __se_sys_bpf kernel/bpf/syscall.c:5732 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5732 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888078489080 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 64 bytes inside of freed 96-byte region [ffff888078489080, ffff8880784890e0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78489 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888015841280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000200020 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 0x352800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 5363, tgid 5362 (syz.0.12), ts 71502719406, free_ts 71501433879 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1518 prep_new_page mm/page_alloc.c:1526 [inline] get_page_from_freelist+0x3004/0x30c0 mm/page_alloc.c:3477 __alloc_pages_noprof+0x29e/0x780 mm/page_alloc.c:4744 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2364 allocate_slab+0x5a/0x2f0 mm/slub.c:2527 new_slab mm/slub.c:2580 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3767 __slab_alloc+0x58/0xa0 mm/slub.c:3857 __slab_alloc_node mm/slub.c:3910 [inline] slab_alloc_node mm/slub.c:4069 [inline] __do_kmalloc_node mm/slub.c:4201 [inline] __kmalloc_node_noprof+0x286/0x440 mm/slub.c:4208 kmalloc_array_node_noprof include/linux/slab.h:788 [inline] alloc_slab_obj_exts+0x3a/0xa0 mm/slub.c:1976 __memcg_slab_post_alloc_hook+0x31c/0x7e0 mm/memcontrol.c:3042 memcg_slab_post_alloc_hook mm/slub.c:2160 [inline] slab_post_alloc_hook mm/slub.c:4042 [inline] slab_alloc_node mm/slub.c:4081 [inline] kmem_cache_alloc_lru_noprof+0x1e6/0x2b0 mm/slub.c:4100 proc_alloc_inode+0x2a/0xc0 fs/proc/inode.c:57 alloc_inode fs/inode.c:346 [inline] new_inode_pseudo fs/inode.c:1149 [inline] new_inode+0x6e/0x310 fs/inode.c:1168 proc_pid_make_inode+0x1f/0x130 fs/proc/base.c:1949 proc_pident_instantiate+0x76/0x2b0 fs/proc/base.c:2695 proc_pident_lookup+0x1c7/0x2a0 fs/proc/base.c:2731 page last free pid 5363 tgid 5362 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1099 [inline] free_unref_page+0xc07/0xd90 mm/page_alloc.c:2652 vfree+0x186/0x2e0 mm/vmalloc.c:3380 bpf_check+0x87b7/0x1a110 kernel/bpf/verifier.c:22330 bpf_prog_load+0x1667/0x20f0 kernel/bpf/syscall.c:2839 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5627 __do_sys_bpf kernel/bpf/syscall.c:5734 [inline] __se_sys_bpf kernel/bpf/syscall.c:5732 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5732 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888078488f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888078489000: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888078489080: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888078489100: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff888078489180: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ==================================================================