================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0xa2f/0x1e90 fs/ext4/xattr.c:1719 Read of size 18446744073709551552 at addr ffff88805003f2e8 by task syz.3.164/4992 CPU: 1 PID: 4992 Comm: syz.3.164 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:0x7f335f78e929 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:00007f3360579038 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f335f9b6080 RCX: 00007f335f78e929 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 00002000000000c0 RBP: 00007f335f810b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f335f9b6080 R15: 00007ffd78ccbaf8 The buggy address belongs to the physical page: page:ffffea0001400fc0 refcount:2 mapcount:0 mapping:ffff8880231ceaf8 index:0x2 pfn:0x5003f memcg:ffff888079b2a000 aops:def_blk_aops ino:700003 flags: 0xfff58000002056(referenced|uptodate|lru|workingset|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff58000002056 ffffea00014623c8 ffffea0001748b48 ffff8880231ceaf8 raw: 0000000000000002 ffff888055bee3a0 00000002ffffffff ffff888079b2a000 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 4988, tgid 4987 (syz.3.164), ts 103475334734, free_ts 103277920797 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 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu+0xff/0x210 mm/mmu_gather.c:261 zap_pte_range mm/memory.c:1525 [inline] zap_pmd_range mm/memory.c:1574 [inline] zap_pud_range mm/memory.c:1603 [inline] zap_p4d_range mm/memory.c:1624 [inline] unmap_page_range+0x1f4a/0x2500 mm/memory.c:1645 unmap_vmas+0x22c/0x330 mm/memory.c:1730 exit_mmap+0x1cc/0x8e0 mm/mmap.c:3238 __mmput+0x118/0x3c0 kernel/fork.c:1200 exit_mm+0x1e6/0x2c0 kernel/exit.c:565 do_exit+0x8b9/0x2400 kernel/exit.c:858 do_group_exit+0x217/0x2d0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030 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 Memory state around the buggy address: ffff88805003f180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805003f200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805003f280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88805003f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805003f380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================