======================================================= 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:1805 [inline] BUG: KASAN: use-after-free in ocfs2_dir_foreach_blk+0x1501/0x18a0 fs/ocfs2/dir.c:1933 Read of size 2 at addr ffff8880556438c9 by task syz.0.16/5855 CPU: 0 UID: 0 PID: 5855 Comm: syz.0.16 Not tainted syzkaller #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 ocfs2_check_dir_entry fs/ocfs2/dir.c:305 [inline] ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1805 [inline] ocfs2_dir_foreach_blk+0x1501/0x18a0 fs/ocfs2/dir.c:1933 ocfs2_readdir+0x254/0x4c0 fs/ocfs2/dir.c:1977 wrap_directory_iterator+0x93/0xe0 fs/readdir.c:65 iterate_dir+0x396/0x570 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:326 [inline] __se_sys_getdents+0xe4/0x250 fs/readdir.c:312 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd23938e969 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:00007fd23a175038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007fd2395b5fa0 RCX: 00007fd23938e969 RDX: 0000000000000058 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007fd239410ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd2395b5fa0 R15: 00007fffbbb93708 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xf4e pfn:0x55643 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000f4e 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 6, migratetype Movable, gfp_mask 0x8(__GFP_MOVABLE), pid 30, tgid 30 (kcompactd1), ts 144544442050, free_ts 144544457203 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 mark_allocated_noprof mm/compaction.c:85 [inline] release_free_list+0x1cb/0x250 mm/compaction.c:107 compact_zone+0x427f/0x4ab0 mm/compaction.c:2725 kcompactd_do_work mm/compaction.c:3098 [inline] kcompactd+0x97d/0x1290 mm/compaction.c:3192 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 30 tgid 30 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_pages_ok+0xa83/0xbe0 mm/page_alloc.c:1571 release_free_list+0x1de/0x250 mm/compaction.c:108 compact_zone+0x427f/0x4ab0 mm/compaction.c:2725 kcompactd_do_work mm/compaction.c:3098 [inline] kcompactd+0x97d/0x1290 mm/compaction.c:3192 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888055643780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888055643800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888055643880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888055643900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888055643980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================