================================================================== BUG: KASAN: use-after-free in sysv_new_inode+0xfc7/0x1160 fs/sysv/ialloc.c:153 Read of size 2 at addr ffff888047df71ce by task syz.2.201/6598 CPU: 1 UID: 0 PID: 6598 Comm: syz.2.201 Not tainted 6.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/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 sysv_new_inode+0xfc7/0x1160 fs/sysv/ialloc.c:153 sysv_mknod+0x4e/0xe0 fs/sysv/namei.c:53 lookup_open fs/namei.c:3595 [inline] open_last_lookups fs/namei.c:3694 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3930 do_filp_open+0x235/0x490 fs/namei.c:3960 do_sys_openat2+0x13e/0x1d0 fs/open.c:1415 do_sys_open fs/open.c:1430 [inline] __do_sys_openat fs/open.c:1446 [inline] __se_sys_openat fs/open.c:1441 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1441 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 RIP: 0033:0x7f7751b7e719 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:00007f7752a03038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f7751d36058 RCX: 00007f7751b7e719 RDX: 000000000000275a RSI: 0000000020000240 RDI: ffffffffffffff9c RBP: 00007f7751bf1616 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7751d36058 R15: 00007fffcaf66f58 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x695de pfn:0x47df7 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 00000000000695de 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 6598, tgid 6592 (syz.2.201), ts 353118781723, free_ts 369770069868 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1541 compaction_alloc_noprof mm/compaction.c:1870 [inline] compaction_alloc+0x3225/0x3960 mm/compaction.c:1880 migrate_folio_unmap mm/migrate.c:1214 [inline] migrate_pages_batch+0x872/0x36d0 mm/migrate.c:1798 migrate_pages_sync mm/migrate.c:1964 [inline] migrate_pages+0x2062/0x3560 mm/migrate.c:2073 compact_zone+0x3404/0x4af0 mm/compaction.c:2641 compact_node+0x2de/0x460 mm/compaction.c:2910 kcompactd+0x788/0x1530 mm/compaction.c:3208 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page last free pid 33 tgid 33 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1112 [inline] free_unref_page+0xcd0/0xf00 mm/page_alloc.c:2642 __folio_put+0x2c7/0x440 mm/swap.c:126 migrate_folio_move mm/migrate.c:1409 [inline] migrate_pages_batch+0x2c4b/0x36d0 mm/migrate.c:1898 migrate_pages_sync mm/migrate.c:1964 [inline] migrate_pages+0x2062/0x3560 mm/migrate.c:2073 compact_zone+0x3404/0x4af0 mm/compaction.c:2641 compact_node+0x2de/0x460 mm/compaction.c:2910 kcompactd+0x788/0x1530 mm/compaction.c:3208 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/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: ffff888047df7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888047df7100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888047df7180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888047df7200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888047df7280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================