loop0: detected capacity change from 0 to 1024 ======================================================= WARNING: The mand mount option has been deprecated and and is ignored by this kernel. Remove the mand option from the mount to silence this warning. ======================================================= EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. evm: overlay not supported EXT4-fs error (device loop0): ext4_mb_mark_diskspace_used:4193: comm syz.0.0: Allocating blocks 497-513 which overlap fs metadata ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:841 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 Read of size 4 at addr ffff8880549a7018 by task syz.0.0/5319 CPU: 0 UID: 0 PID: 5319 Comm: syz.0.0 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 ext4_ext_binsearch fs/ext4/extents.c:841 [inline] ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 ext4_ext_map_blocks+0x288/0x6ac0 fs/ext4/extents.c:4208 ext4_map_create_blocks fs/ext4/inode.c:609 [inline] ext4_map_blocks+0x860/0x1740 fs/ext4/inode.c:811 mpage_map_one_extent fs/ext4/inode.c:2374 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2468 [inline] ext4_do_writepages+0x1f88/0x4610 fs/ext4/inode.c:2931 ext4_writepages+0x205/0x350 fs/ext4/inode.c:3025 do_writepages+0x32e/0x550 mm/page-writeback.c:2604 filemap_fdatawrite_wbc mm/filemap.c:389 [inline] __filemap_fdatawrite_range mm/filemap.c:422 [inline] file_write_and_wait_range+0x23e/0x340 mm/filemap.c:797 generic_buffers_fsync_noflush+0x6c/0x180 fs/buffer.c:609 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline] ext4_sync_file+0x332/0xb20 fs/ext4/fsync.c:147 ovl_sync_file+0x3a/0x50 fs/overlayfs/copy_up.c:254 ovl_copy_up_metadata+0x831/0xb60 fs/overlayfs/copy_up.c:725 ovl_copy_up_tmpfile fs/overlayfs/copy_up.c:893 [inline] ovl_do_copy_up fs/overlayfs/copy_up.c:999 [inline] ovl_copy_up_one fs/overlayfs/copy_up.c:1202 [inline] ovl_copy_up_flags+0x17e0/0x3170 fs/overlayfs/copy_up.c:1257 ovl_setattr+0x10b/0x550 fs/overlayfs/inode.c:40 notify_change+0xc1a/0xf40 fs/attr.c:546 chmod_common+0x248/0x400 fs/open.c:650 do_fchmodat+0x12d/0x200 fs/open.c:697 __do_sys_fchmodat fs/open.c:716 [inline] __se_sys_fchmodat fs/open.c:713 [inline] __x64_sys_fchmodat+0x7d/0x90 fs/open.c:713 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6f13f8f7c9 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:00007f6f14ec2038 EFLAGS: 00000246 ORIG_RAX: 000000000000010c RAX: ffffffffffffffda RBX: 00007f6f141e5fa0 RCX: 00007f6f13f8f7c9 RDX: 0000000000000000 RSI: 00002000000000c0 RDI: 0000000000000005 RBP: 00007f6f14013f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f6f141e6038 R14: 00007f6f141e5fa0 R15: 00007ffde87b8478 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x549a7 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea0001526a08 ffffea0001526988 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner info is not present (never set?) Memory state around the buggy address: ffff8880549a6f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880549a6f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880549a7000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880549a7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880549a7100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================