EXT4-fs (loop2): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs error (device loop2): ext4_xattr_ibody_get:617: inode #18: comm syz-executor.2: corrupted in-inode xattr ================================================================== BUG: KASAN: use-after-free in get_max_inline_xattr_value_size+0x369/0x510 fs/ext4/inline.c:61 Read of size 4 at addr ffff8881ea5cd004 by task syz-executor.2/6877 CPU: 1 PID: 6877 Comm: syz-executor.2 Not tainted 5.4.242-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 get_max_inline_xattr_value_size+0x369/0x510 fs/ext4/inline.c:61 ext4_get_max_inline_size+0x134/0x1f0 fs/ext4/inline.c:112 ext4_try_to_write_inline_data+0xda/0x1720 fs/ext4/inline.c:672 ext4_write_begin+0x25a/0x1900 fs/ext4/inode.c:1314 ext4_da_write_begin+0x4a3/0xfe0 fs/ext4/inode.c:3120 generic_perform_write+0x2c7/0x560 mm/filemap.c:3311 __generic_file_write_iter+0x224/0x530 mm/filemap.c:3440 ext4_file_write_iter+0x499/0x10e0 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1981 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x5d3/0x750 fs/read_write.c:496 vfs_write+0x206/0x4e0 fs/read_write.c:558 ksys_write+0x199/0x2c0 fs/read_write.c:611 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Allocated by task 6336: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 kmalloc include/linux/slab.h:561 [inline] context_struct_to_string+0x441/0x8a0 security/selinux/ss/services.c:1238 security_sid_to_context_core+0x274/0x390 security/selinux/ss/services.c:1335 selinux_inode_init_security+0x6df/0xad0 security/selinux/hooks.c:2957 security_inode_init_security+0x14e/0x3e0 security/security.c:998 __ext4_new_inode+0x2fb9/0x3f10 fs/ext4/ialloc.c:1168 ext4_symlink+0x4a1/0xef0 fs/ext4/namei.c:3423 vfs_symlink+0x36c/0x500 fs/namei.c:4208 do_symlinkat+0x19b/0x400 fs/namei.c:4235 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 6336: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0x123/0x370 mm/slub.c:4071 security_inode_init_security+0x2ba/0x3e0 security/security.c:1012 __ext4_new_inode+0x2fb9/0x3f10 fs/ext4/ialloc.c:1168 ext4_symlink+0x4a1/0xef0 fs/ext4/namei.c:3423 vfs_symlink+0x36c/0x500 fs/namei.c:4208 do_symlinkat+0x19b/0x400 fs/namei.c:4235 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881ea5cd000 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 4 bytes inside of 32-byte region [ffff8881ea5cd000, ffff8881ea5cd020) The buggy address belongs to the page: page:ffffea0007a97340 refcount:1 mapcount:0 mapping:ffff8881f5c03400 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea0007786b40 0000000d00000008 ffff8881f5c03400 raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x19b/0x2e0 mm/slub.c:3909 kmalloc include/linux/slab.h:561 [inline] context_struct_to_string+0x441/0x8a0 security/selinux/ss/services.c:1238 security_sid_to_context_core+0x274/0x390 security/selinux/ss/services.c:1335 selinux_inode_init_security+0x6df/0xad0 security/selinux/hooks.c:2957 security_inode_init_security+0x14e/0x3e0 security/security.c:998 shmem_symlink+0x144/0x5f0 mm/shmem.c:3073 vfs_symlink+0x36c/0x500 fs/namei.c:4208 do_symlinkat+0x19b/0x400 fs/namei.c:4235 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4951 [inline] __free_pages+0xaf/0x140 mm/page_alloc.c:4959 __free_slab+0x221/0x2e0 mm/slub.c:1774 __slab_free+0x34b/0x360 mm/slub.c:3012 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x1d9/0x210 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x41/0x210 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 getname_flags+0xb8/0x4e0 fs/namei.c:141 user_path_at_empty+0x28/0x50 fs/namei.c:2683 user_path_at include/linux/namei.h:49 [inline] vfs_statx+0x115/0x210 fs/stat.c:187 vfs_fstatat include/linux/fs.h:3372 [inline] __do_sys_newfstatat fs/stat.c:367 [inline] __se_sys_newfstatat+0xce/0x770 fs/stat.c:361 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881ea5ccf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881ea5ccf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881ea5cd000: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ^ ffff8881ea5cd080: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff8881ea5cd100: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ================================================================== EXT4-fs error (device loop2): ext4_read_block_bitmap_nowait:430: comm syz-executor.2: Invalid block bitmap block 4294967295 in block_group 0