================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0xa2f/0x1e90 fs/ext4/xattr.c:1719 Read of size 18446744073709551552 at addr ffff8880722af2e8 by task syz.7.607/7380 CPU: 0 PID: 7380 Comm: syz.7.607 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x220 mm/kasan/report.c:427 kasan_report+0x10b/0x140 mm/kasan/report.c:531 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189 memmove+0x25/0x60 mm/kasan/shadow.c:54 ext4_xattr_set_entry+0xa2f/0x1e90 fs/ext4/xattr.c:1719 ext4_xattr_ibody_set+0x250/0x690 fs/ext4/xattr.c:2229 ext4_xattr_move_to_block fs/ext4/xattr.c:2632 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2700 [inline] ext4_expand_extra_isize_ea+0x10e5/0x19b0 fs/ext4/xattr.c:2792 __ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5965 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6008 [inline] __ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6086 ext4_setattr+0x1457/0x19f0 fs/ext4/inode.c:5596 notify_change+0xc74/0xf40 fs/attr.c:499 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3285 [inline] do_open fs/namei.c:3630 [inline] path_openat+0x27f2/0x2e70 fs/namei.c:3783 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_creat fs/open.c:1412 [inline] __se_sys_creat fs/open.c:1406 [inline] __x64_sys_creat+0x8c/0xb0 fs/open.c:1406 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f8998b8e929 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:00007f89999a1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f8998db6080 RCX: 00007f8998b8e929 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 00002000000000c0 RBP: 00007f8998c10b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f8998db6080 R15: 00007ffd40ac1808 The buggy address belongs to the physical page: page:ffffea0001c8abc0 refcount:3 mapcount:0 mapping:ffff888148ce1df8 index:0x2 pfn:0x722af memcg:ffff888072d7e000 aops:def_blk_aops ino:700007 flags: 0xfff58000002056(referenced|uptodate|lru|workingset|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff58000002056 ffffea00014c8e88 ffffea00015a4048 ffff888148ce1df8 raw: 0000000000000002 ffff888051606570 00000003ffffffff ffff888072d7e000 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_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 7371, tgid 7370 (syz.7.607), ts 287829170863, free_ts 286886607725 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 folio_alloc+0x1c/0x60 mm/mempolicy.c:2292 filemap_alloc_folio+0xdb/0x460 mm/filemap.c:999 __filemap_get_folio+0x697/0xdd0 mm/filemap.c:1993 pagecache_get_page+0x26/0x250 mm/folio-compat.c:110 find_or_create_page include/linux/pagemap.h:646 [inline] grow_dev_page fs/buffer.c:946 [inline] grow_buffers fs/buffer.c:1011 [inline] __getblk_slow fs/buffer.c:1038 [inline] __getblk_gfp+0x2d8/0xb20 fs/buffer.c:1333 sb_getblk include/linux/buffer_head.h:356 [inline] __ext4_get_inode_loc+0x474/0xdf0 fs/ext4/inode.c:4512 ext4_get_inode_loc fs/ext4/inode.c:4640 [inline] ext4_reserve_inode_write+0x10a/0x290 fs/ext4/inode.c:5904 __ext4_mark_inode_dirty+0x16e/0x770 fs/ext4/inode.c:6081 __ext4_new_inode+0x3085/0x3a20 fs/ext4/ialloc.c:1350 ext4_create+0x22a/0x460 fs/ext4/namei.c:2883 lookup_open fs/namei.c:3482 [inline] open_last_lookups fs/namei.c:3550 [inline] path_openat+0x1187/0x2e70 fs/namei.c:3780 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384 free_unref_page_list+0xbb/0x8e0 mm/page_alloc.c:3525 release_pages+0x1f92/0x2200 mm/swap.c:1035 __pagevec_release+0x6d/0xe0 mm/swap.c:1055 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x75b/0x2050 mm/shmem.c:946 shmem_truncate_range mm/shmem.c:1062 [inline] shmem_evict_inode+0x248/0xa40 mm/shmem.c:1171 evict+0x485/0x870 fs/inode.c:705 __dentry_kill+0x431/0x650 fs/dcache.c:611 dentry_kill+0xb8/0x290 fs/dcache.c:-1 dput+0xfa/0x1d0 fs/dcache.c:918 __fput+0x5e0/0x920 fs/file_table.c:328 task_work_run+0x1ca/0x250 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffff8880722af180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880722af200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880722af280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880722af300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880722af380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================