loop0: detected capacity change from 0 to 512 EXT4-fs: Ignoring removed i_version option EXT4-fs warning (device loop0): ext4_expand_extra_isize_ea:2848: Unable to expand inode 15. Delete some EAs or run e2fsck. EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. loop0: detected capacity change from 512 to 64 ================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x9c1/0x1e20 fs/ext4/xattr.c:1751 Read of size 18446744073709551600 at addr ffff888054297300 by task syz.0.0/5357 CPU: 0 UID: 0 PID: 5357 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 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:189 __asan_memmove+0x29/0x70 mm/kasan/shadow.c:94 ext4_xattr_set_entry+0x9c1/0x1e20 fs/ext4/xattr.c:1751 ext4_xattr_ibody_set+0x254/0x6a0 fs/ext4/xattr.c:2263 ext4_destroy_inline_data_nolock+0x214/0x5b0 fs/ext4/inline.c:463 ext4_destroy_inline_data+0x83/0xe0 fs/ext4/inline.c:1788 ext4_do_writepages+0x526/0x4610 fs/ext4/inode.c:2810 ext4_writepages+0x205/0x350 fs/ext4/inode.c:3025 do_writepages+0x32e/0x550 mm/page-writeback.c:2634 filemap_fdatawrite_wbc mm/filemap.c:386 [inline] __filemap_fdatawrite_range mm/filemap.c:419 [inline] file_write_and_wait_range+0x23e/0x340 mm/filemap.c:794 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 generic_write_sync include/linux/fs.h:3042 [inline] ext4_buffered_write_iter+0x2ca/0x3a0 fs/ext4/file.c:305 ext4_file_write_iter+0x298/0x1bc0 fs/ext4/file.c:-1 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x5c9/0xb30 fs/read_write.c:686 ksys_pwrite64 fs/read_write.c:793 [inline] __do_sys_pwrite64 fs/read_write.c:801 [inline] __se_sys_pwrite64 fs/read_write.c:798 [inline] __x64_sys_pwrite64+0x193/0x220 fs/read_write.c:798 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:0x7f2279d8ebe9 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:00007f227ac93038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f2279fb5fa0 RCX: 00007f2279d8ebe9 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007f2279e11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000fecc R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2279fb6038 R14: 00007f2279fb5fa0 R15: 00007ffe552df4b8 The buggy address belongs to the physical page: page: refcount:3 mapcount:0 mapping:ffff88803218cd80 index:0x2 pfn:0x54297 memcg:ffff88801c2a8d00 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff18000004214(referenced|dirty|workingset|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff18000004214 0000000000000000 dead000000000122 ffff88803218cd80 raw: 0000000000000002 ffff88804483a740 00000003ffffffff ffff88801c2a8d00 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_MOVABLE|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 5357, tgid 5356 (syz.0.0), ts 73046377665, free_ts 73001252030 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2507 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2517 filemap_alloc_folio_noprof+0xdf/0x470 mm/filemap.c:1007 __filemap_get_folio+0x3f2/0xaf0 mm/filemap.c:1981 grow_dev_folio fs/buffer.c:1050 [inline] grow_buffers fs/buffer.c:1116 [inline] __getblk_slow fs/buffer.c:1134 [inline] bdev_getblk+0x1ad/0x660 fs/buffer.c:1461 __getblk include/linux/buffer_head.h:380 [inline] sb_getblk include/linux/buffer_head.h:386 [inline] __ext4_get_inode_loc+0x561/0x1040 fs/ext4/inode.c:4866 ext4_get_inode_loc fs/ext4/inode.c:4994 [inline] ext4_reserve_inode_write+0x18b/0x360 fs/ext4/inode.c:6323 ext4_xattr_set_handle+0x504/0x1590 fs/ext4/xattr.c:2387 ext4_xattr_set+0x230/0x320 fs/ext4/xattr.c:2549 __vfs_setxattr+0x43c/0x480 fs/xattr.c:200 __vfs_setxattr_noperm+0x12d/0x660 fs/xattr.c:234 vfs_setxattr+0x16b/0x2f0 fs/xattr.c:321 page last free pid 5357 tgid 5356 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] free_unref_folios+0xdbd/0x1520 mm/page_alloc.c:2952 folios_put_refs+0x559/0x640 mm/swap.c:997 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x49e/0x14b0 mm/shmem.c:1157 shmem_truncate_range mm/shmem.c:1269 [inline] shmem_evict_inode+0x272/0xa70 mm/shmem.c:1397 evict+0x504/0x9c0 fs/inode.c:810 __dentry_kill+0x209/0x660 fs/dcache.c:669 dput+0x19f/0x2b0 fs/dcache.c:911 __fput+0x68e/0xa70 fs/file_table.c:476 fput_close_sync+0x119/0x200 fs/file_table.c:573 __do_sys_close fs/open.c:1587 [inline] __se_sys_close fs/open.c:1572 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1572 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 Memory state around the buggy address: ffff888054297200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888054297280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888054297300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888054297380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888054297400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================