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 nobh option EXT4-fs: Ignoring removed bh option EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. infiniband syz0: set active infiniband syz0: added bond0 RDS/IB: syz0: added smc: adding ib device syz0 with port count 1 smc: ib device syz0 port 1 has pnetid ================================================================== BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x17ab/0x1e20 fs/ext4/xattr.c:1731 Write of size 268435536 at addr ffff8880544fd400 by task syz.0.0/5325 CPU: 0 UID: 0 PID: 5325 Comm: syz.0.0 Not tainted 6.16.0-rc2-syzkaller-00024-g9afe652958c3 #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:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:189 __asan_memset+0x22/0x50 mm/kasan/shadow.c:84 ext4_xattr_set_entry+0x17ab/0x1e20 fs/ext4/xattr.c:1731 ext4_xattr_block_set+0x61b/0x2ac0 fs/ext4/xattr.c:1951 ext4_xattr_set_handle+0x1350/0x1590 fs/ext4/xattr.c:2447 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 do_setxattr fs/xattr.c:636 [inline] filename_setxattr+0x274/0x600 fs/xattr.c:665 path_setxattrat+0x364/0x3a0 fs/xattr.c:713 __do_sys_lsetxattr fs/xattr.c:754 [inline] __se_sys_lsetxattr fs/xattr.c:750 [inline] __x64_sys_lsetxattr+0xbf/0xe0 fs/xattr.c:750 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:0x7f7b4178e929 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:00007f7b4265a038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bd RAX: ffffffffffffffda RBX: 00007f7b419b5fa0 RCX: 00007f7b4178e929 RDX: 0000200000000300 RSI: 0000200000000240 RDI: 00002000000000c0 RBP: 00007f7b41810b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000381 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7b419b5fa0 R15: 00007ffc423e6b98 The buggy address belongs to the physical page: page: refcount:3 mapcount:0 mapping:ffff888031d84d78 index:0x20 pfn:0x544fd memcg:ffff88801bee0d00 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff18000004014(referenced|dirty|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff18000004014 0000000000000000 dead000000000122 ffff888031d84d78 raw: 0000000000000020 ffff888031d630e8 00000003ffffffff ffff88801bee0d00 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 5325, tgid 5324 (syz.0.0), ts 74077500305, free_ts 73950929910 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419 alloc_frozen_pages_noprof mm/mempolicy.c:2490 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2510 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2520 filemap_alloc_folio_noprof+0xdf/0x470 mm/filemap.c:1007 __filemap_get_folio+0x3f2/0xaf0 mm/filemap.c:1980 grow_dev_folio fs/buffer.c:1050 [inline] grow_buffers fs/buffer.c:1116 [inline] __getblk_slow fs/buffer.c:1140 [inline] bdev_getblk+0x1c4/0x690 fs/buffer.c:1467 __getblk include/linux/buffer_head.h:382 [inline] sb_getblk include/linux/buffer_head.h:388 [inline] ext4_xattr_block_set+0x1d6b/0x2ac0 fs/ext4/xattr.c:2121 ext4_xattr_set_handle+0xdfb/0x1590 fs/ext4/xattr.c:2447 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 do_setxattr fs/xattr.c:636 [inline] filename_setxattr+0x274/0x600 fs/xattr.c:665 page last free pid 5326 tgid 5324 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1248 [inline] free_unref_folios+0xc66/0x14d0 mm/page_alloc.c:2763 folios_put_refs+0x559/0x640 mm/swap.c:992 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x49e/0x14b0 mm/shmem.c:1125 shmem_truncate_range mm/shmem.c:1237 [inline] shmem_evict_inode+0x272/0xa70 mm/shmem.c:1365 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:473 fput_close_sync+0x119/0x200 fs/file_table.c:570 __do_sys_close fs/open.c:1589 [inline] __se_sys_close fs/open.c:1574 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1574 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: ffff8880544fef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880544fef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880544ff000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880544ff080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880544ff100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================