================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0xed4/0x1190 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff88810977b1ce by task syz-executor.1/7225 CPU: 0 PID: 7225 Comm: syz-executor.1 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+0xed4/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_sys_openat fs/open.c:1436 [inline] __se_sys_openat fs/open.c:1431 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1431 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:0x7fde2ec7cee9 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:00007fde2fa090c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fde2edac120 RCX: 00007fde2ec7cee9 RDX: 000000000000275a RSI: 0000000020000080 RDI: ffffffffffffff9c RBP: 00007fde2ecc949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fde2edac120 R15: 00007fff8e36a188 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x65139 pfn:0x10977b flags: 0x57ff00000000000(node=1|zone=2|lastcpupid=0x7ff) raw: 057ff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000065139 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 7088, tgid 7083 (syz-executor.0), ts 224157099939, free_ts 239981521655 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 folio_alloc_noprof+0x1e/0xc0 mm/mempolicy.c:2343 filemap_alloc_folio_noprof+0x3ba/0x490 mm/filemap.c:1008 do_read_cache_folio+0x1b6/0x540 mm/filemap.c:3752 do_read_cache_page mm/filemap.c:3854 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3863 read_mapping_page include/linux/pagemap.h:896 [inline] dir_get_page fs/sysv/dir.c:64 [inline] sysv_find_entry+0x1e5/0x690 fs/sysv/dir.c:157 sysv_inode_by_name+0x71/0x3b0 fs/sysv/dir.c:374 sysv_lookup fs/sysv/namei.c:38 [inline] sysv_lookup+0x8c/0x100 fs/sysv/namei.c:31 lookup_open.isra.0+0x928/0x13c0 fs/namei.c:3483 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_sys_openat fs/open.c:1436 [inline] __se_sys_openat fs/open.c:1431 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1431 page last free pid 7088 tgid 7083 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_folios+0x991/0x1310 mm/page_alloc.c:2632 folios_put_refs+0x487/0x6d0 mm/swap.c:1024 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x334/0xe80 mm/truncate.c:362 sysv_evict_inode+0x20/0x110 fs/sysv/inode.c:289 evict+0x2ed/0x6c0 fs/inode.c:667 iput_final fs/inode.c:1741 [inline] iput.part.0+0x5a8/0x7f0 fs/inode.c:1767 iput+0x5c/0x80 fs/inode.c:1757 dentry_unlink_inode+0x295/0x480 fs/dcache.c:400 __dentry_kill+0x1d0/0x600 fs/dcache.c:603 dput.part.0+0x4b1/0x9b0 fs/dcache.c:845 dput fs/dcache.c:835 [inline] do_one_tree fs/dcache.c:1541 [inline] shrink_dcache_for_umount+0x131/0x390 fs/dcache.c:1555 generic_shutdown_super+0x76/0x3d0 fs/super.c:620 kill_block_super+0x3b/0x90 fs/super.c:1676 deactivate_locked_super+0xbe/0x1a0 fs/super.c:473 deactivate_super+0xde/0x100 fs/super.c:506 cleanup_mnt+0x222/0x450 fs/namespace.c:1267 Memory state around the buggy address: ffff88810977b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810977b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88810977b180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88810977b200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88810977b280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================