================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x11b3/0x3a60 fs/ext4/xattr.c:1731 Read of size 18446744073709551600 at addr ffff88813dac92b8 by task syz.4.595/2715 CPU: 0 PID: 2715 Comm: syz.4.595 Not tainted 5.10.228-syzkaller-00608-g0eb852f47fe5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 memmove+0x2d/0x70 mm/kasan/shadow.c:54 ext4_xattr_set_entry+0x11b3/0x3a60 fs/ext4/xattr.c:1731 ext4_xattr_ibody_set+0x124/0x390 fs/ext4/xattr.c:2234 ext4_destroy_inline_data_nolock+0x1d3/0x5d0 fs/ext4/inline.c:447 ext4_convert_inline_data_to_extent fs/ext4/inline.c:611 [inline] ext4_try_to_write_inline_data+0x695/0x1230 fs/ext4/inline.c:751 ext4_write_begin+0x247/0x1730 fs/ext4/inode.c:1191 generic_perform_write+0x2cd/0x570 mm/filemap.c:3509 ext4_buffered_write_iter+0x482/0x610 fs/ext4/file.c:271 ext4_file_write_iter+0x193/0x1c80 fs/ext4/file.c:685 do_iter_readv_writev+0x58e/0x790 do_iter_write+0x183/0x640 fs/read_write.c:866 vfs_writev+0x26e/0x510 fs/read_write.c:939 do_pwritev fs/read_write.c:1036 [inline] __do_sys_pwritev2 fs/read_write.c:1095 [inline] __se_sys_pwritev2+0x1c6/0x2c0 fs/read_write.c:1086 __x64_sys_pwritev2+0xe5/0x100 fs/read_write.c:1086 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f5660b5bf19 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:00007f565f1b2058 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f5660d22080 RCX: 00007f5660b5bf19 RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000005 RBP: 00007f5660bcfcc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000005412 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5660d22080 R15: 00007ffcd61b9de8 The buggy address belongs to the page: page:ffffea0004f6b240 refcount:2 mapcount:0 mapping:ffff8881102fb150 index:0x2 pfn:0x13dac9 aops:def_blk_aops ino:0 flags: 0x4000000000002014(uptodate|lru|private) raw: 4000000000002014 ffff88810f305020 ffffea0004756388 ffff8881102fb150 raw: 0000000000000002 ffff88812a15e9d8 00000002ffffffff ffff88810f4c2000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88810f4c2000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 2710, ts 115875226196, free_ts 114222377229 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] __page_cache_alloc include/linux/pagemap.h:290 [inline] pagecache_get_page+0x669/0x950 mm/filemap.c:1848 find_or_create_page include/linux/pagemap.h:402 [inline] grow_dev_page fs/buffer.c:976 [inline] grow_buffers fs/buffer.c:1045 [inline] __getblk_slow fs/buffer.c:1072 [inline] __getblk_gfp+0x221/0x7e0 fs/buffer.c:1370 sb_getblk include/linux/buffer_head.h:361 [inline] __ext4_get_inode_loc+0x4c2/0xbf0 fs/ext4/inode.c:4442 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4552 [inline] __ext4_iget+0x516/0x41f0 fs/ext4/inode.c:4777 ext4_orphan_get+0x1e3/0x630 fs/ext4/ialloc.c:1395 ext4_orphan_cleanup+0x696/0xd50 fs/ext4/super.c:3083 ext4_fill_super+0x888c/0x9150 fs/ext4/super.c:5075 mount_bdev+0x262/0x370 fs/super.c:1442 ext4_mount+0x34/0x40 fs/ext4/super.c:6638 legacy_get_tree+0xf1/0x190 fs/fs_context.c:593 vfs_get_tree+0x88/0x290 fs/super.c:1572 do_new_mount+0x2ba/0xb30 fs/namespace.c:2917 path_mount+0x56f/0xcb0 fs/namespace.c:3247 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 __pagevec_release+0x84/0x100 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x7d1/0x1a60 mm/shmem.c:965 shmem_truncate_range mm/shmem.c:1069 [inline] shmem_evict_inode+0x215/0x9d0 mm/shmem.c:1169 evict+0x526/0x9c0 fs/inode.c:612 iput_final fs/inode.c:1736 [inline] iput+0x632/0x7e0 fs/inode.c:1762 dentry_unlink_inode+0x2ea/0x3d0 fs/dcache.c:378 __dentry_kill+0x447/0x650 fs/dcache.c:583 dentry_kill+0xc0/0x2a0 dput+0x40/0x80 fs/dcache.c:883 __fput+0x52e/0x7b0 fs/file_table.c:294 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x129/0x190 kernel/task_work.c:189 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 Memory state around the buggy address: ffff88813dac9180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88813dac9200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88813dac9280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88813dac9300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88813dac9380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs warning (device loop4): ext4_xattr_set_entry:1744: inode #15: comm syz.4.595: unable to update i_inline_off EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr EXT4-fs error (device loop4): ext4_xattr_ibody_find:2210: inode #15: comm syz.4.595: corrupted in-inode xattr