================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x11d2/0x3fb0 fs/ext4/xattr.c:1732 Read of size 18446744073709551552 at addr ffff8880739992e8 by task syz-executor.2/4145 CPU: 1 PID: 4145 Comm: syz-executor.2 Not tainted 6.1.90-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memmove+0x25/0x60 mm/kasan/shadow.c:54 ext4_xattr_set_entry+0x11d2/0x3fb0 fs/ext4/xattr.c:1732 ext4_xattr_ibody_set+0x11d/0x330 fs/ext4/xattr.c:2237 ext4_xattr_move_to_block fs/ext4/xattr.c:2624 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline] ext4_expand_extra_isize_ea+0x1128/0x1bb0 fs/ext4/xattr.c:2784 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5919 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5962 [inline] __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6040 ext4_dirty_inode+0xbf/0x100 fs/ext4/inode.c:6072 __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2433 generic_update_time fs/inode.c:1903 [inline] inode_update_time fs/inode.c:1916 [inline] touch_atime+0x3fa/0x680 fs/inode.c:1988 file_accessed include/linux/fs.h:2595 [inline] filemap_read+0x2ef3/0x31d0 mm/filemap.c:2807 __kernel_read+0x41e/0x8a0 fs/read_write.c:428 integrity_kernel_read+0xac/0xf0 security/integrity/iint.c:228 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0xa57/0x1c00 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x59a/0xc30 security/integrity/ima/ima_api.c:293 process_measurement+0x135c/0x21b0 security/integrity/ima/ima_main.c:351 ima_file_check+0xed/0x170 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3630 [inline] path_openat+0x2687/0x2e60 fs/namei.c:3785 do_filp_open+0x230/0x480 fs/namei.c:3812 do_sys_openat2+0x13b/0x500 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fe436c7cee9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe437a090c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fe436dabf80 RCX: 00007fe436c7cee9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: ffffffffffffff9c RBP: 00007fe436cc949e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe436dabf80 R15: 00007ffc5ea07b18 The buggy address belongs to the physical page: page:ffffea0001ce6640 refcount:2 mapcount:0 mapping:ffff88801f46bef8 index:0x2 pfn:0x73999 memcg:ffff88807d19e000 aops:def_blk_aops ino:700002 flags: 0xfff58000002056(referenced|uptodate|lru|workingset|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff58000002056 ffffea00015a72c8 ffffea00016885c8 ffff88801f46bef8 raw: 0000000000000002 ffff888073671740 00000002ffffffff ffff88807d19e000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x148c40(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 4145, tgid 4144 (syz-executor.2), ts 100726273350, free_ts 100660258601 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5547 folio_alloc+0x1a/0x50 mm/mempolicy.c:2292 filemap_alloc_folio+0xda/0x4f0 mm/filemap.c:971 __filemap_get_folio+0x749/0xe80 mm/filemap.c:1965 pagecache_get_page+0x28/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+0x211/0xa20 fs/buffer.c:1333 sb_getblk_gfp include/linux/buffer_head.h:363 [inline] ext4_sb_breadahead_unmovable+0x63/0xe0 fs/ext4/super.c:257 __ext4_get_inode_loc+0xbbb/0xe40 fs/ext4/inode.c:4583 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4613 [inline] __ext4_iget+0x4ff/0x3ef0 fs/ext4/inode.c:4835 __ext4_fill_super fs/ext4/super.c:5399 [inline] ext4_fill_super+0x6cb9/0x8b50 fs/ext4/super.c:5664 get_tree_bdev+0x3fe/0x620 fs/super.c:1355 vfs_get_tree+0x88/0x270 fs/super.c:1562 do_new_mount+0x2ba/0xb40 fs/namespace.c:3051 do_mount fs/namespace.c:3394 [inline] __do_sys_mount fs/namespace.c:3602 [inline] __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3579 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1440 [inline] free_pcp_prepare mm/page_alloc.c:1490 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358 free_unref_page_list+0x663/0x900 mm/page_alloc.c:3499 release_pages+0x2836/0x2b40 mm/swap.c:1055 __pagevec_release+0x80/0xf0 mm/swap.c:1075 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x48a/0x1340 mm/truncate.c:372 kill_bdev block/bdev.c:76 [inline] blkdev_flush_mapping+0x154/0x2b0 block/bdev.c:664 blkdev_put_whole block/bdev.c:695 [inline] blkdev_put+0x4c0/0x750 block/bdev.c:955 blkdev_close+0x56/0x80 block/fops.c:514 __fput+0x3b7/0x890 fs/file_table.c:320 task_work_run+0x246/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xde/0x100 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+0x60/0x270 kernel/entry/common.c:303 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888073999180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888073999200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888073999280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888073999300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888073999380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================