loop0: detected capacity change from 0 to 2048 EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: none. ================================================================== BUG: KASAN: slab-use-after-free in ext4_find_extent+0x7a2/0xcd0 Read of size 4 at addr ffff888074ebf978 by task syz-executor.0/5610 CPU: 0 PID: 5610 Comm: syz-executor.0 Not tainted 6.2.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 Call Trace: dump_stack_lvl+0x12e/0x1d0 print_report+0x163/0x510 kasan_report+0xce/0x100 ext4_find_extent+0x7a2/0xcd0 ext4_clu_mapped+0xd0/0x7c0 ext4_da_get_block_prep+0x8b3/0x1110 ext4_block_write_begin+0x3f9/0xd30 ext4_da_write_begin+0x4dc/0x830 generic_perform_write+0x2b6/0x500 ext4_buffered_write_iter+0xf5/0x2e0 ext4_file_write_iter+0x199/0x14e0 vfs_write+0x7be/0xb10 ksys_write+0x122/0x200 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f2e0be8c0a9 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:00007f2e0ccb5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f2e0bfabf80 RCX: 00007f2e0be8c0a9 RDX: 00000000175d9003 RSI: 0000000020000200 RDI: 0000000000000004 RBP: 00007f2e0bee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe9fa6b28f R14: 00007f2e0ccb5300 R15: 0000000000022000 Allocated by task 5357: kasan_set_track+0x40/0x60 __kasan_slab_alloc+0x66/0x70 slab_post_alloc_hook+0x68/0x3a0 kmem_cache_alloc_lru+0x127/0x270 new_inode_pseudo+0x75/0x180 create_pipe_files+0x4b/0x690 __do_pipe_flags+0x2c/0x1b0 do_pipe2+0x8b/0x270 __x64_sys_pipe+0x35/0x40 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 5357: kasan_set_track+0x40/0x60 kasan_save_free_info+0x2b/0x40 ____kasan_slab_free+0xd6/0x120 kmem_cache_free+0x2be/0x590 evict+0x48d/0x550 __dentry_kill+0x38b/0x560 dentry_kill+0xbb/0x1e0 dput+0x169/0x300 __fput+0x4d6/0x720 task_work_run+0x20a/0x290 exit_to_user_mode_loop+0xd1/0xf0 exit_to_user_mode_prepare+0xb1/0x140 syscall_exit_to_user_mode+0x54/0x2d0 do_syscall_64+0x4d/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x2f/0x50 __kasan_record_aux_stack+0xb0/0xc0 call_rcu+0x167/0xa70 __dentry_kill+0x38b/0x560 dentry_kill+0xbb/0x1e0 dput+0x169/0x300 simple_recursive_removal+0x24b/0x750 debugfs_remove+0x3f/0x60 ieee80211_debugfs_remove_netdev+0x43/0x90 ieee80211_if_change_type+0xe7/0x7e0 ieee80211_change_iface+0x57/0x3b0 cfg80211_change_iface+0x5cc/0xc50 nl80211_set_interface+0x4df/0x730 genl_rcv_msg+0xa9b/0xe20 netlink_rcv_skb+0x1dd/0x3d0 genl_rcv+0x23/0x30 netlink_unicast+0x5ca/0x830 netlink_sendmsg+0x7a0/0xb50 __sys_sendto+0x380/0x4e0 __x64_sys_sendto+0xd9/0xf0 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888074ebf7b0 which belongs to the cache inode_cache of size 1168 The buggy address is located 456 bytes inside of freed 1168-byte region [ffff888074ebf7b0, ffff888074ebfc40) The buggy address belongs to the physical page: page:ffffea0001d3af00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74ebc head:ffffea0001d3af00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff8881400088c0 0000000000000000 0000000000000001 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 5080, tgid 5080 (syz-executor.0), ts 52692430319, free_ts 14675015751 get_page_from_freelist+0x3792/0x3910 __alloc_pages+0x291/0x7f0 alloc_slab_page+0x6a/0x160 new_slab+0x84/0x2f0 ___slab_alloc+0xa07/0x1000 kmem_cache_alloc_lru+0x1ad/0x270 new_inode_pseudo+0x75/0x180 new_inode+0x1e/0x1b0 debugfs_create_dir+0xd6/0x440 ieee80211_debugfs_add_netdev+0x14d/0xf60 ieee80211_if_add+0x8c7/0x1640 ieee80211_register_hw+0x2a5d/0x3860 mac80211_hwsim_new_radio+0x21ba/0x3c80 hwsim_new_radio_nl+0xc93/0xf90 genl_rcv_msg+0xa9b/0xe20 netlink_rcv_skb+0x1dd/0x3d0 page last free stack trace: free_unref_page_prepare+0xf0e/0xf70 free_unref_page+0x37/0x3f0 free_contig_range+0x9e/0x150 destroy_args+0xe2/0x760 debug_vm_pgtable+0x3eb/0x460 do_one_initcall+0x1c4/0x710 do_initcall_level+0x125/0x1b0 do_initcalls+0x56/0xa0 kernel_init_freeable+0x37f/0x500 kernel_init+0x18/0x1a0 ret_from_fork+0x1f/0x30 Memory state around the buggy address: ffff888074ebf800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888074ebf880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888074ebf900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888074ebf980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888074ebfa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================