EXT4-fs (loop4): encrypted files will use data=ordered instead of data journaling mode EXT4-fs (loop4): 1 truncate cleaned up EXT4-fs (loop4): mounted filesystem without journal. Quota mode: writeback. ================================================================== BUG: KASAN: out-of-bounds in ext4_xattr_set_entry+0x8ca/0x1f30 fs/ext4/xattr.c:1732 Read of size 18446744073709551572 at addr ffff8880306c9850 by task syz.4.330/5353 CPU: 0 PID: 5353 Comm: syz.4.330 Not tainted 6.1.124-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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:316 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:427 kasan_report+0x136/0x160 mm/kasan/report.c:531 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memmove+0x25/0x60 mm/kasan/shadow.c:54 ext4_xattr_set_entry+0x8ca/0x1f30 fs/ext4/xattr.c:1732 ext4_xattr_block_set+0xa58/0x3920 fs/ext4/xattr.c:1979 ext4_xattr_move_to_block fs/ext4/xattr.c:2616 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2691 [inline] ext4_expand_extra_isize_ea+0x10d5/0x1bb0 fs/ext4/xattr.c:2783 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5936 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5979 [inline] __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6057 ext4_dirty_inode+0xbf/0x100 fs/ext4/inode.c:6089 __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2433 generic_update_time fs/inode.c:1946 [inline] inode_update_time fs/inode.c:1959 [inline] __file_update_time+0x221/0x240 fs/inode.c:2147 file_modified_flags+0x3e1/0x480 fs/inode.c:2220 ext4_write_checks+0x24a/0x2c0 fs/ext4/file.c:264 ext4_buffered_write_iter+0xbd/0x3a0 fs/ext4/file.c:280 ext4_file_write_iter+0x1d7/0x1930 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x857/0xbc0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 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:0x7f3738f85d29 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:00007f3739d17038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f3739175fa0 RCX: 00007f3738f85d29 RDX: 0000000000000078 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 00007f3739001b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3739175fa0 R15: 00007ffd4c0f4c38 Allocated by task 5353: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc_node_track_caller+0xb1/0x220 mm/slab_common.c:956 kmemdup+0x26/0x60 mm/util.c:129 ext4_xattr_block_set+0x884/0x3920 fs/ext4/xattr.c:1927 ext4_xattr_move_to_block fs/ext4/xattr.c:2616 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2691 [inline] ext4_expand_extra_isize_ea+0x10d5/0x1bb0 fs/ext4/xattr.c:2783 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5936 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5979 [inline] __ext4_mark_inode_dirty+0x54f/0x920 fs/ext4/inode.c:6057 ext4_dirty_inode+0xbf/0x100 fs/ext4/inode.c:6089 __mark_inode_dirty+0x331/0xf80 fs/fs-writeback.c:2433 generic_update_time fs/inode.c:1946 [inline] inode_update_time fs/inode.c:1959 [inline] __file_update_time+0x221/0x240 fs/inode.c:2147 file_modified_flags+0x3e1/0x480 fs/inode.c:2220 ext4_write_checks+0x24a/0x2c0 fs/ext4/file.c:264 ext4_buffered_write_iter+0xbd/0x3a0 fs/ext4/file.c:280 ext4_file_write_iter+0x1d7/0x1930 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x857/0xbc0 fs/read_write.c:584 ksys_write+0x19c/0x2c0 fs/read_write.c:637 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 The buggy address belongs to the object at ffff8880306c9800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 80 bytes inside of 1024-byte region [ffff8880306c9800, ffff8880306c9c00) The buggy address belongs to the physical page: page:ffffea0000c1b200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x306c8 head:ffffea0000c1b200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000160b600 dead000000000002 ffff888017c41dc0 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 23788906271, free_ts 23439179534 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5605 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc+0xa1/0x230 mm/slab_common.c:949 kmalloc include/linux/slab.h:568 [inline] kzalloc include/linux/slab.h:699 [inline] tomoyo_init_log+0x1b37/0x2040 security/tomoyo/audit.c:275 tomoyo_supervisor+0x396/0x12d0 security/tomoyo/common.c:2088 tomoyo_audit_env_log security/tomoyo/environ.c:36 [inline] tomoyo_env_perm+0x174/0x210 security/tomoyo/environ.c:63 tomoyo_environ security/tomoyo/domain.c:672 [inline] tomoyo_find_next_domain+0x1469/0x1d10 security/tomoyo/domain.c:882 tomoyo_bprm_check_security+0xfe/0x150 security/tomoyo/tomoyo.c:101 security_bprm_check+0x5f/0xa0 security/security.c:869 search_binary_handler fs/exec.c:1729 [inline] exec_binprm fs/exec.c:1782 [inline] bprm_execve+0x8bb/0x18a0 fs/exec.c:1851 kernel_execve+0x8e6/0xa10 fs/exec.c:2016 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+0x12a6/0x15b0 mm/page_alloc.c:3384 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479 kasan_depopulate_vmalloc_pte+0x66/0x80 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2662 [inline] apply_to_pmd_range mm/memory.c:2706 [inline] apply_to_pud_range mm/memory.c:2742 [inline] apply_to_p4d_range mm/memory.c:2778 [inline] __apply_to_page_range+0x9c5/0xcc0 mm/memory.c:2812 kasan_release_vmalloc+0x96/0xb0 mm/kasan/shadow.c:492 __purge_vmap_area_lazy+0x157c/0x1720 mm/vmalloc.c:1774 _vm_unmap_aliases+0x476/0x4e0 mm/vmalloc.c:2177 change_page_attr_set_clr+0x304/0xe70 arch/x86/mm/pat/set_memory.c:1821 change_page_attr_set arch/x86/mm/pat/set_memory.c:1871 [inline] set_memory_nx+0xee/0x130 arch/x86/mm/pat/set_memory.c:2064 free_init_pages arch/x86/mm/init.c:933 [inline] free_kernel_image_pages arch/x86/mm/init.c:952 [inline] free_initmem+0x71/0xc0 arch/x86/mm/init.c:979 kernel_init+0x2d/0x290 init/main.c:1523 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff8880306c9700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880306c9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880306c9800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880306c9880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880306c9900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================