R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc6edf493f R14: 00007f337c2ba300 R15: 0000000000022000 ---[ end trace 0000000000000000 ]--- object pointer: 0xffff8881258bd5a4 ================================================================== BUG: KASAN: invalid-free in kfree+0x97/0xf0 mm/slab_common.c:1009 Free of addr ffff8881258bd5a4 by task syz-executor.0/346 CPU: 0 PID: 346 Comm: syz-executor.0 Tainted: G W 6.3.0-syzkaller-13466-gfc4354c6e5c2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x155/0x1c0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x15d/0x540 mm/kasan/report.c:462 kasan_report_invalid_free+0xdc/0x100 mm/kasan/report.c:537 __kasan_kfree_large+0x90/0xa0 mm/kasan/common.c:272 kasan_kfree_large include/linux/kasan.h:170 [inline] free_large_kmalloc+0x67/0xf0 mm/slab_common.c:938 kfree+0x97/0xf0 mm/slab_common.c:1009 kvfree+0x39/0x40 mm/util.c:650 ext4_xattr_move_to_block fs/ext4/xattr.c:2679 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0x122c/0x1d10 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x303/0x3f0 fs/ext4/inode.c:5769 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5812 [inline] __ext4_mark_inode_dirty+0x4b3/0x7b0 fs/ext4/inode.c:5890 __ext4_unlink+0x997/0xbb0 fs/ext4/namei.c:3255 ext4_unlink+0x146/0x400 fs/ext4/namei.c:3298 vfs_unlink+0x390/0x630 fs/namei.c:4327 do_unlinkat+0x487/0x920 fs/namei.c:4393 __do_sys_unlinkat fs/namei.c:4436 [inline] __se_sys_unlinkat fs/namei.c:4429 [inline] __x64_sys_unlinkat+0xd1/0xf0 fs/namei.c:4429 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f337b48c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f337c2ba168 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007f337b5abf80 RCX: 00007f337b48c169 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007f337b4e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc6edf493f R14: 00007f337c2ba300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0004962f40 refcount:2 mapcount:0 mapping:ffff888108487a00 index:0x1 pfn:0x1258bd memcg:ffff88810d620000 aops:def_blk_aops ino:700000 flags: 0x400000000002203e(referenced|uptodate|dirty|lru|active|private|mappedtodisk|zone=1) page_type: 0xffffffff() raw: 400000000002203e ffffea0004791988 ffffea0004962f88 ffff888108487a00 raw: 0000000000000001 ffff88810aca5e70 00000002ffffffff ffff88810d620000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 346, tgid 344 (syz-executor.0), ts 38511524746, free_ts 38465319255 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x223/0x230 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x3442/0x3510 mm/page_alloc.c:3502 __alloc_pages+0x3e7/0x890 mm/page_alloc.c:4768 __folio_alloc+0x19/0x40 mm/page_alloc.c:4800 __folio_alloc_node include/linux/gfp.h:246 [inline] folio_alloc include/linux/gfp.h:275 [inline] filemap_alloc_folio include/linux/pagemap.h:474 [inline] __filemap_get_folio+0x299/0x5a0 mm/filemap.c:1965 pagecache_get_page+0x33/0xf0 mm/folio-compat.c:99 find_or_create_page include/linux/pagemap.h:635 [inline] grow_dev_page fs/buffer.c:995 [inline] grow_buffers fs/buffer.c:1060 [inline] __getblk_slow fs/buffer.c:1087 [inline] __getblk_gfp+0x20b/0x810 fs/buffer.c:1382 sb_getblk include/linux/buffer_head.h:365 [inline] __ext4_get_inode_loc+0x4f1/0xe50 fs/ext4/inode.c:4374 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4487 [inline] __ext4_iget+0x46b/0x3e50 fs/ext4/inode.c:4684 __ext4_fill_super fs/ext4/super.c:5446 [inline] ext4_fill_super+0x510c/0x68d0 fs/ext4/super.c:5672 get_tree_bdev+0x43b/0x670 fs/super.c:1303 ext4_get_tree+0x20/0x30 fs/ext4/super.c:5703 vfs_get_tree+0x8c/0x290 fs/super.c:1510 do_new_mount+0x28f/0xad0 fs/namespace.c:3039 path_mount+0x677/0x1000 fs/namespace.c:3369 do_mount fs/namespace.c:3382 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2c8/0x3b0 fs/namespace.c:3568 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x462/0x6a0 mm/page_alloc.c:2564 free_unref_page_list+0xfb/0x790 mm/page_alloc.c:2705 release_pages+0xe28/0xe80 mm/swap.c:1042 free_pages_and_swap_cache+0x92/0xa0 mm/swap_state.c:317 tlb_batch_pages_flush mm/mmu_gather.c:97 [inline] tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu+0x102/0x200 mm/mmu_gather.c:299 tlb_finish_mmu+0xdb/0x1f0 mm/mmu_gather.c:391 unmap_region+0x258/0x2a0 mm/mmap.c:2222 do_vmi_align_munmap+0xa08/0x1000 mm/mmap.c:2473 do_vmi_munmap+0x242/0x2b0 mm/mmap.c:2530 __vm_munmap+0x200/0x340 mm/mmap.c:2805 __do_sys_munmap mm/mmap.c:2830 [inline] __se_sys_munmap mm/mmap.c:2827 [inline] __x64_sys_munmap+0x64/0x70 mm/mmap.c:2827 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8881258bd480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881258bd500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881258bd580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8881258bd600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881258bd680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================