EXT4-fs (loop2): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
loop2: detected capacity change from 2048 to 64
==================================================================
BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x9c1/0x1e20
Read of size 18446744073709551600 at addr ffff8881aee29eb8 by task syz.2.1495/13633

CPU: 1 UID: 0 PID: 13633 Comm: syz.2.1495 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+0xe8/0x150
 print_address_description+0x55/0x1e0
 print_report+0x58/0x70
 kasan_report+0x117/0x150
 kasan_check_range+0x264/0x2c0
 __asan_memmove+0x29/0x70
 ext4_xattr_set_entry+0x9c1/0x1e20
 ext4_xattr_ibody_set+0x254/0x6a0
 ext4_destroy_inline_data_nolock+0x23a/0x5e0
 ext4_destroy_inline_data+0x83/0xe0
 ext4_do_writepages+0x51e/0x4670
 ext4_writepages+0x241/0x3b0
 do_writepages+0x32e/0x550
 file_write_and_wait_range+0x36e/0x440
 mmb_fsync_noflush+0x76/0x1c0
 ext4_sync_file+0x437/0xd50
 ext4_buffered_write_iter+0x2ca/0x3a0
 ext4_file_write_iter+0x298/0x1bf0
 vfs_write+0x61d/0xb90
 __x64_sys_pwrite64+0x199/0x230
 do_syscall_64+0x15f/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f06f6f9cdd9
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:00007f06f7dc4028 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007f06f7216270 RCX: 00007f06f6f9cdd9
RDX: 0000000000000001 RSI: 0000200000000080 RDI: 0000000000000008
RBP: 00007f06f7032d69 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000feca R11: 0000000000000246 R12: 0000000000000000
R13: 00007f06f7216308 R14: 00007f06f7216270 R15: 00007ffc81a42f88
 </TASK>

The buggy address belongs to the physical page:
page: refcount:2 mapcount:0 mapping:ffff8881078688c0 index:0x2 pfn:0x1aee29
memcg:ffff88816e542700
aops:def_blk_aops ino:700002 dentry name(?):""
flags: 0x57ff58000004234(referenced|dirty|lru|workingset|private|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff58000004234 ffffea0006fcda48 ffff888160496850 ffff8881078688c0
raw: 0000000000000002 ffff8881bc78c740 00000002ffffffff ffff88816e542700
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 13633, tgid 13627 (syz.2.1495), ts 643956229367, free_ts 643742964342
 post_alloc_hook+0x231/0x280
 get_page_from_freelist+0x24ba/0x2540
 __alloc_frozen_pages_noprof+0x18d/0x380
 alloc_pages_mpol+0x235/0x490
 alloc_pages_noprof+0xac/0x2a0
 folio_alloc_noprof+0x1e/0x30
 filemap_alloc_folio_noprof+0x111/0x470
 __filemap_get_folio_mpol+0x3fc/0xb00
 bdev_getblk+0x1f6/0x6e0
 __ext4_get_inode_loc+0x528/0xfa0
 ext4_get_inode_loc+0x81/0xf0
 ext4_xattr_ibody_get+0x113/0x4c0
 ext4_xattr_get+0x123/0x6a0
 __vfs_getxattr+0x3f4/0x430
 cap_inode_need_killpriv+0x45/0x60
 security_inode_need_killpriv+0x85/0x240
page last free pid 13633 tgid 13627 stack trace:
 free_unref_folios+0xcec/0x1480
 folios_put_refs+0x9ff/0xb40
 folio_batch_move_lru+0x4c2/0x550
 lru_add_drain_cpu+0xb8/0x7b0
 lru_add_drain+0x121/0x3e0
 __folio_batch_release+0x48/0x90
 writeback_iter+0x6cd/0x1290
 blkdev_writepages+0x107/0x1b0
 do_writepages+0x32e/0x550
 filemap_write_and_wait_range+0x335/0x3f0
 loop_set_status+0x276/0xe40
 lo_ioctl+0xc21/0x1fb0
 blkdev_ioctl+0x5e3/0x740
 __se_sys_ioctl+0xfc/0x170
 do_syscall_64+0x15f/0xf80
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff8881aee29d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881aee29e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881aee29e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                                        ^
 ffff8881aee29f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881aee29f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
