================================================================== BUG: KASAN: double-free or invalid-free in kfree+0x19e/0x220 mm/slub.c:4574 CPU: 1 PID: 15074 Comm: syz-executor.2 Not tainted 5.15.106-syzkaller-00249-g19c0ed55a470 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/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/0x3b0 mm/kasan/report.c:248 kasan_report_invalid_free+0x6b/0xa0 mm/kasan/report.c:370 __kasan_kfree_large+0x82/0x90 mm/kasan/common.c:398 kasan_kfree_large include/linux/kasan.h:201 [inline] kfree_hook mm/slub.c:1687 [inline] free_nonslab_page+0x3c/0xc0 mm/slub.c:3551 kfree+0x19e/0x220 mm/slub.c:4574 kvfree+0x35/0x40 mm/util.c:658 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:5859 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5902 [inline] __ext4_mark_inode_dirty+0x4af/0x7a0 fs/ext4/inode.c:5980 ext4_inline_data_truncate+0x54a/0xd00 fs/ext4/inline.c:2013 ext4_truncate+0x337/0xfa0 fs/ext4/inode.c:4232 ext4_process_orphan+0x1d3/0x2f0 fs/ext4/orphan.c:339 ext4_orphan_cleanup+0x93d/0x10a0 fs/ext4/orphan.c:474 ext4_fill_super+0x8d67/0x9680 fs/ext4/super.c:4963 mount_bdev+0x281/0x3b0 fs/super.c:1378 ext4_mount+0x34/0x40 fs/ext4/super.c:6567 legacy_get_tree+0xf1/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 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:0x7f59a5f4a69a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007f59a4cbbf88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 000000000000043d RCX: 00007f59a5f4a69a RDX: 0000000020000040 RSI: 0000000020000100 RDI: 00007f59a4cbbfe0 RBP: 00007f59a4cbc020 R08: 00007f59a4cbc020 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000040 R13: 0000000020000100 R14: 00007f59a4cbbfe0 R15: 0000000020000240 The buggy address belongs to the page: page:ffffea0004659800 refcount:3 mapcount:0 mapping:ffff888109196a98 index:0x2 pfn:0x119660 memcg:ffff88810f658000 aops:def_blk_aops ino:700002 flags: 0x400000000000202a(referenced|dirty|active|private|zone=1) raw: 400000000000202a 0000000000000000 dead000000000122 ffff888109196a98 raw: 0000000000000002 ffff88811bcfddc8 00000003ffffffff ffff88810f658000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x108c40(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL), pid 15074, ts 1695132971542, free_ts 1695114226939 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502 prep_new_page mm/page_alloc.c:2508 [inline] get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291 __alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] __page_cache_alloc include/linux/pagemap.h:305 [inline] pagecache_get_page+0xb18/0xeb0 mm/filemap.c:1940 find_or_create_page include/linux/pagemap.h:418 [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_gfp include/linux/buffer_head.h:368 [inline] ext4_sb_breadahead_unmovable+0x6a/0xe0 fs/ext4/super.c:238 __ext4_get_inode_loc+0xaaf/0xcd0 fs/ext4/inode.c:4430 __ext4_get_inode_loc_noinmem fs/ext4/inode.c:4460 [inline] __ext4_iget+0x467/0x3e40 fs/ext4/inode.c:4665 ext4_fill_super+0x7570/0x9680 fs/ext4/super.c:4829 mount_bdev+0x281/0x3b0 fs/super.c:1378 ext4_mount+0x34/0x40 fs/ext4/super.c:6567 legacy_get_tree+0xf1/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 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1370 [inline] free_pcp_prepare mm/page_alloc.c:1442 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441 free_unref_page_list+0x15d/0x980 mm/page_alloc.c:3562 release_pages+0x1310/0x1370 mm/swap.c:1009 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 exit_mmap+0x3ef/0x6f0 mm/mmap.c:3211 __mmput+0x95/0x310 kernel/fork.c:1171 mmput+0x5b/0x170 kernel/fork.c:1194 exit_mm kernel/exit.c:551 [inline] do_exit+0xbb4/0x2b60 kernel/exit.c:862 do_group_exit+0x141/0x310 kernel/exit.c:997 get_signal+0x7a3/0x1630 kernel/signal.c:2891 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff888119660180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888119660200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888119660280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888119660300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888119660380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== EXT4-fs (loop2): 1 truncate cleaned up EXT4-fs (loop2): mounted filesystem without journal. Opts: data_err=abort,errors=continue,debug_want_extra_isize=0x0000000000000040,dioread_nolock,max_batch_time=0x0000000000000008,nombcache,,errors=continue. Quota mode: writeback.