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: Ignoring removed oldalloc option EXT4-fs (loop0): stripe (2) is not aligned with cluster size (16), stripe is disabled EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. EXT4-fs warning (device loop0): ext4_es_cache_extent:1082: inode #15: comm syz.0.0: ES cache extent failed: add [0,32562,18446744073709551615,0x8] conflict with existing [0,1,113,0x2] ================================================================== BUG: KASAN: use-after-free in ext4_ext_split fs/ext4/extents.c:1161 [inline] BUG: KASAN: use-after-free in ext4_ext_create_new_leaf fs/ext4/extents.c:1424 [inline] BUG: KASAN: use-after-free in ext4_ext_insert_extent+0x26da/0x4b50 fs/ext4/extents.c:2120 Write of size 19584 at addr ffff88804806f40c by task syz.0.0/5323 CPU: 0 UID: 0 PID: 5323 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 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x264/0x2c0 mm/kasan/generic.c:200 __asan_memmove+0x40/0x70 mm/kasan/shadow.c:95 ext4_ext_split fs/ext4/extents.c:1161 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1424 [inline] ext4_ext_insert_extent+0x26da/0x4b50 fs/ext4/extents.c:2120 ext4_ext_map_blocks+0x1696/0x58b0 fs/ext4/extents.c:4457 ext4_map_create_blocks+0x11d/0x540 fs/ext4/inode.c:616 ext4_map_blocks+0x7cd/0x11d0 fs/ext4/inode.c:809 _ext4_get_block+0x1e3/0x470 fs/ext4/inode.c:909 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:942 ext4_block_write_begin+0xb14/0x1950 fs/ext4/inode.c:1196 ext4_write_begin+0xb40/0x18c0 fs/ext4/ext4_jbd2.h:-1 ext4_da_write_begin+0x355/0xd80 fs/ext4/inode.c:3123 generic_perform_write+0x2e2/0x8f0 mm/filemap.c:4314 ext4_buffered_write_iter+0xce/0x3a0 fs/ext4/file.c:300 ext4_file_write_iter+0x298/0x1bf0 fs/ext4/file.c:-1 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61d/0xb90 fs/read_write.c:688 ksys_write+0x150/0x270 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f262959c799 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f262a4d9fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f2629815fa0 RCX: 00007f262959c799 RDX: 00000000fffffdef RSI: 00002000000000c0 RDI: 0000000000000008 RBP: 00007f2629632bd9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2629816038 R14: 00007f2629815fa0 R15: 00007ffc9675c1f8 The buggy address belongs to the physical page: page: refcount:3 mapcount:0 mapping:ffff88801cc25900 index:0x44 pfn:0x4806f memcg:ffff88801c6d0d40 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff08000004004(referenced|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff08000004004 0000000000000000 dead000000000122 ffff88801cc25900 raw: 0000000000000044 ffff888047394910 00000003ffffffff ffff88801c6d0d40 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x40c48(GFP_NOFS|__GFP_MOVABLE|__GFP_COMP), pid 5323, tgid 5322 (syz.0.0), ts 87571615790, free_ts 87556794072 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2484 alloc_frozen_pages_noprof mm/mempolicy.c:2555 [inline] alloc_pages_noprof+0xa8/0x190 mm/mempolicy.c:2575 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2585 filemap_alloc_folio_noprof+0x111/0x470 mm/filemap.c:1013 __filemap_get_folio_mpol+0x3fc/0xb00 mm/filemap.c:2006 __filemap_get_folio include/linux/pagemap.h:774 [inline] grow_dev_folio fs/buffer.c:1047 [inline] grow_buffers fs/buffer.c:1113 [inline] __getblk_slow fs/buffer.c:1131 [inline] bdev_getblk+0x1f6/0x6e0 fs/buffer.c:1458 sb_getblk_gfp include/linux/buffer_head.h:392 [inline] ext4_ext_split fs/ext4/extents.c:1127 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1424 [inline] ext4_ext_insert_extent+0x238d/0x4b50 fs/ext4/extents.c:2120 ext4_ext_map_blocks+0x1696/0x58b0 fs/ext4/extents.c:4457 ext4_map_create_blocks+0x11d/0x540 fs/ext4/inode.c:616 ext4_map_blocks+0x7cd/0x11d0 fs/ext4/inode.c:809 _ext4_get_block+0x1e3/0x470 fs/ext4/inode.c:909 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:942 ext4_block_write_begin+0xb14/0x1950 fs/ext4/inode.c:1196 page last free pid 5323 tgid 5322 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] free_unref_folios+0xed5/0x16d0 mm/page_alloc.c:3040 folios_put_refs+0x789/0x8d0 mm/swap.c:1002 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x3dd/0xe30 mm/truncate.c:408 truncate_inode_pages mm/truncate.c:485 [inline] truncate_pagecache+0x6c/0x90 mm/truncate.c:794 ext4_setattr+0xfba/0x1c60 fs/ext4/inode.c:5950 notify_change+0xc1a/0xf40 fs/attr.c:556 do_truncate+0x1c2/0x250 fs/open.c:68 vfs_truncate+0x4b4/0x540 fs/open.c:118 do_sys_truncate+0xf3/0x1c0 fs/open.c:142 __do_sys_truncate fs/open.c:154 [inline] __se_sys_truncate fs/open.c:152 [inline] __x64_sys_truncate+0x5b/0x70 fs/open.c:152 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804806ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88804806ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888048070000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888048070080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888048070100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================