================================================================== BUG: KASAN: use-after-free in check_igot_inode+0x187/0x1b0 fs/ext4/inode.c:4622 Read of size 8 at addr ffff88805e28af30 by task syz-executor.1/15263 CPU: 2 PID: 15263 Comm: syz-executor.1 Not tainted 6.5.0-rc6-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+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 check_igot_inode+0x187/0x1b0 fs/ext4/inode.c:4622 __ext4_iget+0x14fc/0x43b0 fs/ext4/inode.c:4674 __ext4_fill_super fs/ext4/super.c:5467 [inline] ext4_fill_super+0x64c9/0xaf30 fs/ext4/super.c:5696 get_tree_bdev+0x43e/0x7d0 fs/super.c:1318 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fca3be7e1ea Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007fca3cc24ee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fca3cc24f80 RCX: 00007fca3be7e1ea RDX: 00000000200004c0 RSI: 0000000020000500 RDI: 00007fca3cc24f40 RBP: 00000000200004c0 R08: 00007fca3cc24f80 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000500 R13: 00007fca3cc24f40 R14: 00000000000004b0 R15: 00000000200000c0 The buggy address belongs to the physical page: page:ffffea000178a280 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x2 pfn:0x5e28a flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 00fff00000000000 ffffea0001683448 ffffea00016446c8 0000000000000000 raw: 0000000000000002 0000000000000000 00000000ffffff7f 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 0x242050(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE|__GFP_RECLAIMABLE), pid 14533, tgid 14530 (syz-executor.0), ts 2255570958521, free_ts 2259794501105 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages_slowpath.constprop.0+0x2dd/0x2360 mm/page_alloc.c:4011 __alloc_pages+0x411/0x4a0 mm/page_alloc.c:4490 __alloc_pages_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc+0x3a6/0x400 mm/slab.c:3432 kmem_cache_zalloc include/linux/slab.h:693 [inline] ext4_init_io_end+0x24/0x160 fs/ext4/page-io.c:278 ext4_do_writepages+0xcd7/0x34a0 fs/ext4/inode.c:2625 ext4_writepages+0x30b/0x780 fs/ext4/inode.c:2766 do_writepages+0x1b4/0x690 mm/page-writeback.c:2553 filemap_fdatawrite_wbc mm/filemap.c:393 [inline] filemap_fdatawrite_wbc+0x144/0x1b0 mm/filemap.c:383 __filemap_fdatawrite_range+0xba/0x100 mm/filemap.c:426 filemap_write_and_wait_range.part.0+0x81/0x100 mm/filemap.c:681 filemap_write_and_wait_range mm/filemap.c:677 [inline] kiocb_write_and_wait+0xe6/0x1f0 mm/filemap.c:2744 __iomap_dio_rw+0x5ff/0x1da0 fs/iomap/direct-io.c:520 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 slab_destroy mm/slab.c:1608 [inline] slabs_destroy+0x85/0xc0 mm/slab.c:1628 cache_flusharray mm/slab.c:3341 [inline] ___cache_free+0x2b6/0x420 mm/slab.c:3404 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x4c/0x1b0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] __kmem_cache_alloc_node+0x167/0x470 mm/slab.c:3521 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0x4c/0x100 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] tomoyo_realpath_from_path+0xb9/0x710 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x271/0x450 security/tomoyo/file.c:822 security_inode_getattr+0xf1/0x150 security/security.c:2114 vfs_getattr fs/stat.c:167 [inline] vfs_statx+0x180/0x430 fs/stat.c:242 vfs_fstatat+0x90/0xb0 fs/stat.c:276 __do_sys_newfstatat+0x98/0x110 fs/stat.c:446 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff88805e28ae00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805e28ae80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805e28af00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805e28af80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805e28b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================