loop6: detected capacity change from 512 to 0
==================================================================
BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x9c1/0x1e20
Read of size 18446744073709551600 at addr ffff88812960e2b8 by task syz.6.1373/13644

CPU: 1 UID: 0 PID: 13644 Comm: syz.6.1373 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 kasan_check_range+0x2b0/0x2c0
 __asan_memmove+0x29/0x70
 ext4_xattr_set_entry+0x9c1/0x1e20
 ext4_xattr_ibody_set+0x254/0x6a0
 ext4_destroy_inline_data_nolock+0x214/0x5b0
 ext4_convert_inline_data_to_extent+0x540/0xdd0
 ext4_write_begin+0x382/0x19a0
 generic_perform_write+0x2c5/0x900
 ext4_buffered_write_iter+0xce/0x3a0
 ext4_file_write_iter+0x298/0x1bc0
 do_iter_readv_writev+0x61c/0x8b0
 vfs_writev+0x31a/0x960
 do_writev+0x14d/0x2d0
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3f8b98ebe9
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:00007f3f8c850038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007f3f8bbc5fa0 RCX: 00007f3f8b98ebe9
RDX: 0000000000000001 RSI: 0000200000000140 RDI: 0000000000000006
RBP: 00007f3f8ba11e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3f8bbc6038 R14: 00007f3f8bbc5fa0 R15: 00007ffe8ff3b5a8
 </TASK>

The buggy address belongs to the physical page:
page: refcount:3 mapcount:0 mapping:ffff888103488880 index:0x2 pfn:0x12960e
memcg:ffff88801b6f4100
aops:def_blk_aops ino:700006 dentry name(?):""
flags: 0x57ff18000004214(referenced|dirty|workingset|private|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff18000004214 0000000000000000 dead000000000122 ffff888103488880
raw: 0000000000000002 ffff88803a878740 00000003ffffffff ffff88801b6f4100
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 13644, tgid 13643 (syz.6.1373), ts 421723221906, free_ts 421687895070
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 alloc_pages_noprof+0xa9/0x190
 folio_alloc_noprof+0x1e/0x30
 filemap_alloc_folio_noprof+0xdf/0x470
 __filemap_get_folio+0x3f2/0xaf0
 bdev_getblk+0x1ad/0x660
 __ext4_get_inode_loc+0x561/0x1040
 ext4_get_inode_loc+0x81/0xf0
 ext4_xattr_ibody_get+0x111/0x510
 ext4_xattr_get+0x123/0x6a0
 __vfs_getxattr+0x3f4/0x430
 cap_inode_need_killpriv+0x45/0x60
 security_inode_need_killpriv+0x89/0x270
page last free pid 12710 tgid 12710 stack trace:
 free_unref_folios+0xdbd/0x1520
 folios_put_refs+0x559/0x640
 shmem_undo_range+0x49e/0x14b0
 shmem_evict_inode+0x272/0xa70
 evict+0x504/0x9c0
 __dentry_kill+0x209/0x660
 dput+0x19f/0x2b0
 do_renameat2+0x6de/0xa80
 __x64_sys_rename+0x82/0x90
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88812960e180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88812960e200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88812960e280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                        ^
 ffff88812960e300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88812960e380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
