loop0: detected capacity change from 0 to 262144 JBD2: Ignoring recovery information on journal ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode. ================================================================== BUG: KASAN: use-after-free in ocfs2_check_dir_entry fs/ocfs2/dir.c:305 [inline] BUG: KASAN: use-after-free in ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1784 [inline] BUG: KASAN: use-after-free in ocfs2_dir_foreach_blk+0x1704/0x1b20 fs/ocfs2/dir.c:1912 Read of size 2 at addr ffff888047f4d008 by task syz.0.0/5314 CPU: 0 UID: 0 PID: 5314 Comm: syz.0.0 Not tainted 6.13.0-rc6-syzkaller-00059-g643e2e259c2b #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 ocfs2_check_dir_entry fs/ocfs2/dir.c:305 [inline] ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1784 [inline] ocfs2_dir_foreach_blk+0x1704/0x1b20 fs/ocfs2/dir.c:1912 ocfs2_readdir+0x2a1/0x5e0 fs/ocfs2/dir.c:1956 wrap_directory_iterator+0x91/0xd0 fs/readdir.c:65 iterate_dir+0x571/0x800 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64+0x1e2/0x4b0 fs/readdir.c:389 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:0x7f55bbd85d29 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:00007f55bcaf7038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f55bbf75fa0 RCX: 00007f55bbd85d29 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007f55bbe01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f55bbf75fa0 R15: 00007ffe0de96818 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x2917 pfn:0x47f4d flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea00011fd388 ffffea00011fc188 0000000000000000 raw: 0000000000002917 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 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 5224, tgid 5224 (syz-executor), ts 66431465997, free_ts 72866739735 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2269 alloc_pages_noprof mm/mempolicy.c:2348 [inline] folio_alloc_noprof+0x128/0x180 mm/mempolicy.c:2355 filemap_alloc_folio_noprof+0xdf/0x500 mm/filemap.c:1000 page_cache_ra_unbounded+0x30e/0x720 mm/readahead.c:268 filemap_readahead mm/filemap.c:2509 [inline] filemap_get_pages+0x95f/0x2080 mm/filemap.c:2554 filemap_read+0x452/0xf50 mm/filemap.c:2637 __kernel_read+0x513/0x9d0 fs/read_write.c:523 integrity_kernel_read+0xb0/0x100 security/integrity/iint.c:28 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:480 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline] ima_calc_file_hash+0xae6/0x1b30 security/integrity/ima/ima_crypto.c:568 ima_collect_measurement+0x520/0xb10 security/integrity/ima/ima_api.c:293 process_measurement+0x1351/0x1fb0 security/integrity/ima/ima_main.c:372 ima_file_check+0xd9/0x120 security/integrity/ima/ima_main.c:572 security_file_post_open+0xb9/0x280 security/security.c:3121 page last free pid 81 tgid 81 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_folios+0xe39/0x18b0 mm/page_alloc.c:2706 shrink_folio_list+0x3193/0x5ca0 mm/vmscan.c:1490 evict_folios+0x3c86/0x5800 mm/vmscan.c:4600 try_to_shrink_lruvec+0x9a6/0xc70 mm/vmscan.c:4796 shrink_one+0x3b9/0x850 mm/vmscan.c:4841 shrink_many mm/vmscan.c:4904 [inline] lru_gen_shrink_node mm/vmscan.c:4982 [inline] shrink_node+0x37c5/0x3e50 mm/vmscan.c:5963 kswapd_shrink_node mm/vmscan.c:6792 [inline] balance_pgdat mm/vmscan.c:6984 [inline] kswapd+0x1ca9/0x36f0 mm/vmscan.c:7253 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: ffff888047f4cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888047f4cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888047f4d000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888047f4d080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888047f4d100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================