EXT4-fs warning (device loop0): dx_probe:892: inode #2: comm syz.0.16: dx entry: limit 0 != root limit 124 EXT4-fs warning (device loop0): dx_probe:965: inode #2: comm syz.0.16: Corrupt directory, running e2fsck is recommended ================================================================== BUG: KASAN: use-after-free in __ext4_check_dir_entry+0x6f3/0x870 fs/ext4/dir.c:85 Read of size 2 at addr ffff888075a74003 by task syz.0.16/3707 CPU: 1 PID: 3707 Comm: syz.0.16 Not tainted 6.1.97-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 __ext4_check_dir_entry+0x6f3/0x870 fs/ext4/dir.c:85 ext4_readdir+0x139e/0x3950 fs/ext4/dir.c:258 iterate_dir+0x224/0x560 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f7d43575bd9 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:00007f7d4431e048 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f7d43703f60 RCX: 00007f7d43575bd9 RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000008 RBP: 00007f7d435e4e60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f7d43703f60 R15: 00007fffb8e1b898 The buggy address belongs to the physical page: page:ffffea0001d69d00 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x75a74 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001e61308 ffffea0000a16308 0000000000000000 raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 3654, tgid 3652 (syz.4.5), ts 76987740022, free_ts 77851882691 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4283 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5551 vm_area_alloc_pages mm/vmalloc.c:2992 [inline] __vmalloc_area_node mm/vmalloc.c:3068 [inline] __vmalloc_node_range+0x92b/0x1490 mm/vmalloc.c:3240 vmalloc_user+0x70/0x80 mm/vmalloc.c:3394 vb2_vmalloc_alloc+0xee/0x330 drivers/media/common/videobuf2/videobuf2-vmalloc.c:47 __vb2_buf_mem_alloc drivers/media/common/videobuf2/videobuf2-core.c:233 [inline] __vb2_queue_alloc+0x74c/0x1340 drivers/media/common/videobuf2/videobuf2-core.c:444 vb2_core_reqbufs+0xaea/0x13c0 drivers/media/common/videobuf2/videobuf2-core.c:848 v4l2_m2m_reqbufs drivers/media/v4l2-core/v4l2-mem2mem.c:579 [inline] v4l2_m2m_ioctl_reqbufs+0xea/0x1c0 drivers/media/v4l2-core/v4l2-mem2mem.c:1373 __video_do_ioctl+0xa3a/0xe30 drivers/media/v4l2-core/v4l2-ioctl.c:3037 video_usercopy+0xa79/0x10c0 drivers/media/v4l2-core/v4l2-ioctl.c:3384 v4l2_ioctl+0x181/0x1d0 drivers/media/v4l2-core/v4l2-dev.c:364 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3362 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3457 __vunmap+0x834/0x9a0 mm/vmalloc.c:2717 vb2_vmalloc_put+0x64/0xa0 drivers/media/common/videobuf2/videobuf2-vmalloc.c:68 __vb2_buf_mem_free+0x100/0x290 drivers/media/common/videobuf2/videobuf2-core.c:266 __vb2_free_mem drivers/media/common/videobuf2/videobuf2-core.c:492 [inline] __vb2_queue_free+0x485/0xd40 drivers/media/common/videobuf2/videobuf2-core.c:537 vb2_core_queue_release+0x5a/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2477 v4l2_m2m_ctx_release+0x1a/0x30 drivers/media/v4l2-core/v4l2-mem2mem.c:1273 vicodec_release+0x93/0x110 drivers/media/test-drivers/vicodec/vicodec-core.c:1933 v4l2_release+0x1de/0x390 drivers/media/v4l2-core/v4l2-dev.c:456 __fput+0x3b7/0x890 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:179 get_signal+0x15fc/0x17d0 kernel/signal.c:2639 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:174 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 Memory state around the buggy address: ffff888075a73f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888075a73f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888075a74000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888075a74080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888075a74100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================