================================================================== 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 ffff88802324da40 by task syz.1.67/5687 CPU: 1 UID: 0 PID: 5687 Comm: syz.1.67 Not tainted 6.11.0-rc3-next-20240816-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/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:0x7f0c1ab79e79 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:00007fff5b89d268 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4 RAX: 0000000000000000 RBX: 00007f0c1ad17a80 RCX: 00007f0c1ab79e79 RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003 RBP: 00007f0c1ad17a80 R08: 0000000000000006 R09: 00007fff5b89d54f R10: 000000000003fdb4 R11: 0000000000000246 R12: 0000000000014c2e R13: 00007fff5b89d360 R14: 00007fff5b89d380 R15: ffffffffffffffff Allocated by task 5688: 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 5688: 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 ffff88802324da00 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 64 bytes inside of freed 96-byte region [ffff88802324da00, ffff88802324da60) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2324d anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888015841280 0000000000000000 dead000000000001 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 69, tgid 69 (kworker/u8:4), ts 7491332213, free_ts 0 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] __kmalloc_cache_noprof+0x1d5/0x2c0 mm/slub.c:4228 kmalloc_noprof include/linux/slab.h:681 [inline] blk_alloc_queue_stats+0x4c/0x100 block/blk-stat.c:210 blk_alloc_queue+0xc1/0x580 block/blk-core.c:403 blk_mq_alloc_queue+0x19e/0x2f0 block/blk-mq.c:4151 scsi_alloc_sdev+0x772/0xb90 drivers/scsi/scsi_scan.c:337 scsi_probe_and_add_lun+0x1db/0x4be0 drivers/scsi/scsi_scan.c:1210 __scsi_scan_target+0x205/0x1080 drivers/scsi/scsi_scan.c:1757 scsi_scan_channel drivers/scsi/scsi_scan.c:1845 [inline] scsi_scan_host_selected+0x37e/0x690 drivers/scsi/scsi_scan.c:1874 do_scsi_scan_host drivers/scsi/scsi_scan.c:2013 [inline] do_scan_async+0x138/0x7a0 drivers/scsi/scsi_scan.c:2023 page_owner free stack trace missing Memory state around the buggy address: ffff88802324d900: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff88802324d980: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88802324da00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88802324da80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ffff88802324db00: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================