================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0xecc/0x1190 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff88802bbcc1ce by task syz-executor.3/6153 CPU: 2 PID: 6153 Comm: syz-executor.3 Not tainted 6.10.0-rc3-syzkaller-00044-g2ccbdf43d5e7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-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 sysv_new_inode+0xecc/0x1190 fs/sysv/ialloc.c:153 sysv_mknod fs/sysv/namei.c:53 [inline] sysv_create+0x20/0xf0 fs/sysv/namei.c:67 lookup_open.isra.0+0x10a1/0x13c0 fs/namei.c:3505 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x29f0 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 do_sys_openat2+0x17a/0x1e0 fs/open.c:1405 do_sys_open fs/open.c:1420 [inline] __do_compat_sys_openat fs/open.c:1480 [inline] __se_compat_sys_openat fs/open.c:1478 [inline] __ia32_compat_sys_openat+0x16e/0x210 fs/open.c:1478 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:0xf72fc579 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:00000000f5eee5ac EFLAGS: 00000292 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 0000000020000080 RDX: 000000000000275a RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2bbcc flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000a2bb08 ffffea00006f8108 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x540dc0(GFP_USER|__GFP_COMP|__GFP_ZERO|__GFP_ACCOUNT), pid 8583, tgid 8582 (syz-executor.1), ts 202919791156, free_ts 203494195328 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2e50 mm/page_alloc.c:3420 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4678 alloc_pages_mpol_noprof+0x275/0x610 mm/mempolicy.c:2265 pagetable_alloc_noprof include/linux/mm.h:2903 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:70 [inline] pte_alloc_one+0x20/0x370 arch/x86/mm/pgtable.c:33 __pte_alloc+0x6e/0x3a0 mm/memory.c:442 do_anonymous_page mm/memory.c:4429 [inline] do_pte_missing mm/memory.c:3901 [inline] handle_pte_fault mm/memory.c:5380 [inline] __handle_mm_fault+0x4308/0x53f0 mm/memory.c:5523 handle_mm_fault+0x476/0xa00 mm/memory.c:5688 faultin_page mm/gup.c:1290 [inline] __get_user_pages+0x473/0x1490 mm/gup.c:1589 __get_user_pages_locked mm/gup.c:1857 [inline] __gup_longterm_locked+0x243/0x2790 mm/gup.c:2556 pin_user_pages_remote+0xee/0x150 mm/gup.c:3616 process_vm_rw_single_vec mm/process_vm_access.c:106 [inline] process_vm_rw_core.constprop.0+0x439/0xa10 mm/process_vm_access.c:216 process_vm_rw+0x301/0x360 mm/process_vm_access.c:284 __do_sys_process_vm_readv mm/process_vm_access.c:296 [inline] __se_sys_process_vm_readv mm/process_vm_access.c:292 [inline] __ia32_sys_process_vm_readv+0xdf/0x1b0 mm/process_vm_access.c:292 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 page last free pid 8571 tgid 8571 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2583 __folio_put+0x239/0x360 mm/swap.c:129 folio_put include/linux/mm.h:1508 [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: ffff88802bbcc080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802bbcc100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88802bbcc180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802bbcc200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802bbcc280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- 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