================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0xed4/0x1190 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff88804b76c1ce by task syz-executor.0/8857 CPU: 2 PID: 8857 Comm: syz-executor.0 Not tainted 6.10.0-rc5-syzkaller #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+0xed4/0x1190 fs/sysv/ialloc.c:153 sysv_mknod fs/sysv/namei.c:53 [inline] sysv_create+0x20/0xf0 fs/sysv/namei.c:67 vfs_create fs/namei.c:3207 [inline] vfs_create+0x4c2/0x770 fs/namei.c:3191 do_mknodat+0x3d5/0x5d0 fs/namei.c:4059 __do_sys_mknod fs/namei.c:4092 [inline] __se_sys_mknod fs/namei.c:4090 [inline] __x64_sys_mknod+0x119/0x170 fs/namei.c:4090 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 RIP: 0033:0x7fe91107cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe911ec20c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000085 RAX: ffffffffffffffda RBX: 00007fe9111abf80 RCX: 00007fe91107cee9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000040 RBP: 00007fe9110c949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe9111abf80 R15: 00007ffcb724a2f8 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88804b76cd98 pfn:0x4b76c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: ffff88804b76cd98 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x152c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 8857, tgid 8855 (syz-executor.0), ts 247322395059, free_ts 263096561897 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_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:3989 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4008 alloc_buffer_head+0x21/0x160 fs/buffer.c:3028 folio_alloc_buffers+0x2c1/0x780 fs/buffer.c:931 create_empty_buffers+0x36/0x480 fs/buffer.c:1673 folio_create_buffers+0x109/0x150 fs/buffer.c:1784 block_read_full_folio+0x20a/0xa70 fs/buffer.c:2388 filemap_read_folio+0xe5/0x2c0 mm/filemap.c:2355 do_read_cache_folio+0x203/0x540 mm/filemap.c:3788 do_read_cache_page mm/filemap.c:3854 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3863 page last free pid 9021 tgid 9021 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 __put_partials+0x14c/0x170 mm/slub.c:2995 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4008 vm_area_alloc+0x1f/0x230 kernel/fork.c:467 __install_special_mapping+0x2e/0x3e0 mm/mmap.c:3641 map_vdso+0x166/0x4f0 arch/x86/entry/vdso/vma.c:245 arch_setup_additional_pages+0x33/0x50 arch/x86/entry/vdso/vma.c:319 load_elf_binary+0x1f08/0x4db0 fs/binfmt_elf.c:1237 search_binary_handler fs/exec.c:1797 [inline] exec_binprm fs/exec.c:1839 [inline] bprm_execve fs/exec.c:1891 [inline] bprm_execve+0x703/0x19b0 fs/exec.c:1867 kernel_execve+0x3cf/0x4e0 fs/exec.c:2058 call_usermodehelper_exec_async+0x255/0x4c0 kernel/umh.c:110 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff88804b76c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804b76c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804b76c180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804b76c200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804b76c280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================