================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0xa48/0x1f30 fs/ext4/xattr.c:1710 Read of size 18446744073709551552 at addr ffff88805967f2e8 by task syz.0.177/5060 CPU: 0 PID: 5060 Comm: syz.0.177 Not tainted 6.1.111-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/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+0xa48/0x1f30 fs/ext4/xattr.c:1710 ext4_xattr_ibody_set+0x264/0x720 fs/ext4/xattr.c:2220 ext4_xattr_move_to_block fs/ext4/xattr.c:2622 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2690 [inline] ext4_expand_extra_isize_ea+0x1128/0x1bb0 fs/ext4/xattr.c:2782 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5933 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5976 [inline] __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6054 ext4_dirty_inode+0xbf/0x100 fs/ext4/inode.c:6086 __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2433 generic_update_time fs/inode.c:1938 [inline] inode_update_time fs/inode.c:1951 [inline] touch_atime+0x3fa/0x680 fs/inode.c:2023 file_accessed include/linux/fs.h:2600 [inline] filemap_read+0x2ef3/0x31d0 mm/filemap.c:2807 __kernel_read+0x421/0x890 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+0x559/0xc40 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/0x4f0 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:0x7f538dd7def9 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:00007f538ebf6038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f538df36130 RCX: 00007f538dd7def9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f538ddf0b76 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f538df36130 R15: 00007fff2a01adb8 The buggy address belongs to the physical page: page:ffffea0001659fc0 refcount:3 mapcount:0 mapping:ffff888140c949f8 index:0x2 pfn:0x5967f memcg:ffff888059766000 aops:def_blk_aops ino:700000 flags: 0xfff5800000a056(referenced|uptodate|lru|workingset|private|writeback|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff5800000a056 ffffea000159dac8 ffffea0001cea808 ffff888140c949f8 raw: 0000000000000002 ffff888074aa7910 00000003ffffffff ffff888059766000 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 5049, tgid 5047 (syz.0.177), ts 203120174555, free_ts 148920823244 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4290 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5558 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:4594 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4624 [inline] __ext4_iget+0x4ff/0x3ee0 fs/ext4/inode.c:4846 __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:1366 vfs_get_tree+0x88/0x270 fs/super.c:1573 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:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3464 __vunmap+0x834/0x9a0 mm/vmalloc.c:2717 pcpu_mem_free mm/percpu.c:527 [inline] pcpu_free_chunk mm/percpu.c:1505 [inline] pcpu_destroy_chunk mm/percpu-vm.c:368 [inline] pcpu_balance_free+0x928/0xc40 mm/percpu.c:2022 pcpu_balance_workfn+0x103a/0x10e0 mm/percpu.c:2247 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88805967f180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805967f200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88805967f280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88805967f300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805967f380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================