================================================================== BUG: KASAN: slab-use-after-free in consumer_filter kernel/events/uprobes.c:869 [inline] BUG: KASAN: slab-use-after-free in filter_chain+0xf6/0x110 kernel/events/uprobes.c:880 Read of size 8 at addr ffff88806ebd4130 by task syz.3.6531/27492 CPU: 2 PID: 27492 Comm: syz.3.6531 Not tainted 6.10.0-rc7-syzkaller-00076-g9d9a2f29aefd #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:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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_filter kernel/events/uprobes.c:869 [inline] filter_chain+0xf6/0x110 kernel/events/uprobes.c:880 uprobe_mmap+0x46b/0x1240 kernel/events/uprobes.c:1387 mmap_region+0x1228/0x2760 mm/mmap.c:2987 do_mmap+0xbc7/0xf60 mm/mmap.c:1397 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:573 ksys_mmap_pgoff+0x332/0x5d0 mm/mmap.c:1443 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 RIP: 0023:0xf746f579 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:00000000f5d8757c EFLAGS: 00000292 ORIG_RAX: 00000000000000c0 RAX: ffffffffffffffda RBX: 0000000020000000 RCX: 0000000000003000 RDX: 0000000000000001 RSI: 0000000000000012 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 27470: 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:4123 [inline] __kmalloc_noprof+0x1ec/0x420 mm/slub.c:4136 kmalloc_noprof include/linux/slab.h:664 [inline] kmalloc_array_noprof include/linux/slab.h:699 [inline] security_inode_init_security+0x13e/0x380 security/security.c:1720 shmem_symlink+0x138/0x6b0 mm/shmem.c:3520 vfs_symlink fs/namei.c:4495 [inline] vfs_symlink+0x3e8/0x660 fs/namei.c:4479 do_symlinkat+0x263/0x310 fs/namei.c:4521 __do_sys_symlinkat fs/namei.c:4537 [inline] __se_sys_symlinkat fs/namei.c:4534 [inline] __ia32_sys_symlinkat+0x97/0xc0 fs/namei.c:4534 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 27470: 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:2196 [inline] slab_free mm/slub.c:4438 [inline] kfree+0x12a/0x3b0 mm/slub.c:4559 security_inode_init_security+0x29c/0x380 security/security.c:1748 shmem_symlink+0x138/0x6b0 mm/shmem.c:3520 vfs_symlink fs/namei.c:4495 [inline] vfs_symlink+0x3e8/0x660 fs/namei.c:4479 do_symlinkat+0x263/0x310 fs/namei.c:4521 __do_sys_symlinkat fs/namei.c:4537 [inline] __se_sys_symlinkat fs/namei.c:4534 [inline] __ia32_sys_symlinkat+0x97/0xc0 fs/namei.c:4534 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 ffff88806ebd4100 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of freed 64-byte region [ffff88806ebd4100, ffff88806ebd4140) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806ebd4c80 pfn:0x6ebd4 flags: 0x4fff00000000200(workingset|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 04fff00000000200 ffff8880154428c0 ffff888040000588 ffffea0001627b50 raw: ffff88806ebd4c80 000000000020001c 00000001ffffefff 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 23274, tgid 23274 (kvm-nx-lpage-re), ts 1176817325311, free_ts 1176658343143 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x1353/0x2e50 mm/page_alloc.c:3425 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4683 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2265 allocate_slab mm/slub.c:2428 [inline] new_slab+0x84/0x260 mm/slub.c:2481 ___slab_alloc+0xdac/0x1870 mm/slub.c:3667 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3990 [inline] kmalloc_trace_noprof+0x2c5/0x310 mm/slub.c:4149 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] allocate_cgrp_cset_links+0xc6/0x240 kernel/cgroup/cgroup.c:1121 find_css_set+0x998/0x1c40 kernel/cgroup/cgroup.c:1199 cgroup_migrate_prepare_dst+0x10b/0x7f0 kernel/cgroup/cgroup.c:2782 cgroup_attach_task+0x48f/0x920 kernel/cgroup/cgroup.c:2886 cgroup_attach_task_all+0xd4/0x130 kernel/cgroup/cgroup-v1.c:70 kvm_vm_worker_thread+0x2ff/0x6a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:6565 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 page last free pid 23284 tgid 23284 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2588 __folio_put+0x239/0x360 mm/swap.c:129 folio_put include/linux/mm.h:1513 [inline] free_page_and_swap_cache+0x249/0x2c0 mm/swap_state.c:305 __tlb_remove_table arch/x86/include/asm/tlb.h:34 [inline] __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x89/0xe0 mm/mmu_gather.c:282 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x216/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Memory state around the buggy address: ffff88806ebd4000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88806ebd4080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88806ebd4100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88806ebd4180: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88806ebd4200: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ================================================================== ---------------- 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