================================================================== BUG: KASAN: double-free or invalid-free in kfree+0x19e/0x220 mm/slub.c:4556 CPU: 0 PID: 428 Comm: syz-executor.0 Not tainted 5.15.106-syzkaller #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+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3a0 mm/kasan/report.c:248 kasan_report_invalid_free+0x52/0x80 mm/kasan/report.c:373 __kasan_kfree_large+0x82/0x90 mm/kasan/common.c:399 kasan_kfree_large include/linux/kasan.h:238 [inline] kfree_hook mm/slub.c:1669 [inline] free_nonslab_page+0x3c/0xc0 mm/slub.c:3533 kfree+0x19e/0x220 mm/slub.c:4556 kvfree+0x35/0x40 mm/util.c:654 ext4_xattr_move_to_block fs/ext4/xattr.c:2628 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2691 [inline] ext4_expand_extra_isize_ea+0x1063/0x1bc0 fs/ext4/xattr.c:2783 __ext4_expand_extra_isize+0x303/0x3f0 fs/ext4/inode.c:5828 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5871 [inline] __ext4_mark_inode_dirty+0x4af/0x7a0 fs/ext4/inode.c:5949 __ext4_unlink+0x8cd/0xae0 fs/ext4/namei.c:3255 ext4_unlink+0x142/0x3f0 fs/ext4/namei.c:3298 vfs_unlink+0x38c/0x630 fs/namei.c:4209 do_unlinkat+0x47d/0x910 fs/namei.c:4277 __do_sys_unlinkat fs/namei.c:4320 [inline] __se_sys_unlinkat fs/namei.c:4313 [inline] __x64_sys_unlinkat+0xcd/0xf0 fs/namei.c:4313 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fc9082a8169 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:00007fc907e1b168 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007fc9083c7f80 RCX: 00007fc9082a8169 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007fc908303ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd9180fa4f R14: 00007fc907e1b300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea00048b5980 refcount:3 mapcount:0 mapping:ffff888108fad978 index:0x1 pfn:0x122d66 memcg:ffff88811f986000 aops:def_blk_aops ino:700000 flags: 0x400000000002202e(referenced|uptodate|dirty|active|private|mappedtodisk|zone=1) raw: 400000000002202e 0000000000000000 dead000000000122 ffff888108fad978 raw: 0000000000000001 ffff888120879b28 00000003ffffffff ffff88811f986000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 428, ts 38404605174, free_ts 38357906670 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x15d/0x170 mm/page_alloc.c:2420 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x33e6/0x34c0 mm/page_alloc.c:4159 __alloc_pages+0x38a/0x7b0 mm/page_alloc.c:5421 __alloc_pages_node include/linux/gfp.h:570 [inline] alloc_pages_node include/linux/gfp.h:584 [inline] alloc_pages include/linux/gfp.h:597 [inline] __page_cache_alloc include/linux/pagemap.h:304 [inline] pagecache_get_page+0xa5b/0xdf0 mm/filemap.c:1940 find_or_create_page include/linux/pagemap.h:420 [inline] grow_dev_page fs/buffer.c:949 [inline] grow_buffers fs/buffer.c:1014 [inline] __getblk_slow fs/buffer.c:1041 [inline] __getblk_gfp+0x21e/0x7c0 fs/buffer.c:1336 sb_getblk include/linux/buffer_head.h:361 [inline] __ext4_get_inode_loc+0x4ce/0xcd0 fs/ext4/inode.c:4321 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4429 [inline] __ext4_iget+0x467/0x3e30 fs/ext4/inode.c:4634 ext4_fill_super+0x7570/0x9680 fs/ext4/super.c:4830 mount_bdev+0x281/0x3b0 fs/super.c:1378 ext4_mount+0x34/0x40 fs/ext4/super.c:6568 legacy_get_tree+0xee/0x190 fs/fs_context.c:610 vfs_get_tree+0x88/0x290 fs/super.c:1508 do_new_mount+0x28b/0xac0 fs/namespace.c:2994 path_mount+0x671/0x1070 fs/namespace.c:3324 do_mount fs/namespace.c:3337 [inline] __do_sys_mount fs/namespace.c:3545 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3522 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3522 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1413 [inline] free_unref_page_prepare+0x7a9/0x7e0 mm/page_alloc.c:3317 free_unref_page_list+0x1aa/0x6d0 mm/page_alloc.c:3433 release_pages+0xe33/0xe90 mm/swap.c:963 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 unmap_region+0x304/0x350 mm/mmap.c:2668 __do_munmap+0x142d/0x1ae0 mm/mmap.c:2899 __vm_munmap+0x131/0x230 mm/mmap.c:2922 __do_sys_munmap mm/mmap.c:2948 [inline] __se_sys_munmap mm/mmap.c:2944 [inline] __x64_sys_munmap+0x6b/0x80 mm/mmap.c:2944 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888122d66480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888122d66500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888122d66580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888122d66600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888122d66680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================