================================================================== BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:516 [inline] BUG: KASAN: use-after-free in relay_switch_subbuf+0x837/0x900 kernel/relay.c:676 Read of size 8 at addr ffff8880354af960 by task syz-executor.1/21212 CPU: 0 PID: 21212 Comm: syz-executor.1 Not tainted 5.19.0-rc4-next-20220628-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xbe/0x1f0 mm/kasan/report.c:495 d_inode include/linux/dcache.h:516 [inline] relay_switch_subbuf+0x837/0x900 kernel/relay.c:676 relay_reserve include/linux/relay.h:248 [inline] trace_note+0x5af/0x720 kernel/trace/blktrace.c:95 trace_note_tsk kernel/trace/blktrace.c:126 [inline] __blk_add_trace+0xbfb/0xdf0 kernel/trace/blktrace.c:267 blk_add_trace_bio+0x326/0x4f0 kernel/trace/blktrace.c:905 trace_block_bio_queue include/trace/events/block.h:355 [inline] submit_bio_noacct+0x13ff/0x1b30 block/blk-core.c:843 submit_bio block/blk-core.c:901 [inline] submit_bio+0xd7/0x300 block/blk-core.c:873 submit_bh_wbc+0x4bc/0x670 fs/buffer.c:2718 submit_bh fs/buffer.c:2724 [inline] __bread_slow fs/buffer.c:1177 [inline] __bread_gfp+0x178/0x3b0 fs/buffer.c:1381 sb_bread include/linux/buffer_head.h:304 [inline] omfs_fill_super+0x88a/0x1ad0 fs/omfs/inode.c:485 mount_bdev+0x385/0x450 fs/super.c:1371 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1501 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f4f11e8a72a 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:00007f4f12fc7f88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000540 RCX: 00007f4f11e8a72a RDX: 0000000020000040 RSI: 0000000020000080 RDI: 00007f4f12fc7fe0 RBP: 00007f4f12fc8020 R08: 00007f4f12fc8020 R09: 0000000020000040 R10: 0000000000000002 R11: 0000000000000206 R12: 0000000020000040 R13: 0000000020000080 R14: 00007f4f12fc7fe0 R15: 0000000020000600 Allocated by task 19743: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:736 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc_lru+0x376/0x720 mm/slub.c:3275 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc+0x4a/0x230 fs/dcache.c:1849 d_alloc_parallel+0xe7/0x1af0 fs/dcache.c:2601 __lookup_slow+0x193/0x480 fs/namei.c:1686 lookup_one_len+0x16a/0x1a0 fs/namei.c:2730 start_creating.part.0+0x135/0x280 fs/debugfs/inode.c:352 start_creating fs/debugfs/inode.c:325 [inline] __debugfs_create_file+0xa9/0x540 fs/debugfs/inode.c:397 kvm_create_vm_debugfs arch/x86/kvm/../../../virt/kvm/kvm_main.c:1080 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4910 [inline] kvm_dev_ioctl+0x15fb/0x1cc0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4937 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:2793 dentry_free+0xc3/0x160 fs/dcache.c:377 __dentry_kill+0x4cb/0x640 fs/dcache.c:621 dentry_kill fs/dcache.c:745 [inline] dput+0x64d/0xdb0 fs/dcache.c:913 find_next_child fs/libfs.c:264 [inline] simple_recursive_removal+0x136/0x830 fs/libfs.c:279 debugfs_remove fs/debugfs/inode.c:742 [inline] debugfs_remove+0x59/0x80 fs/debugfs/inode.c:736 kvm_destroy_vm_debugfs+0xc4/0x240 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1011 kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1273 [inline] kvm_put_kvm+0x104/0xb70 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1338 kvm_vm_release+0x3f/0x50 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1361 __fput+0x277/0x9d0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:2793 dentry_free+0xc3/0x160 fs/dcache.c:377 __dentry_kill+0x4cb/0x640 fs/dcache.c:621 dentry_kill fs/dcache.c:745 [inline] dput+0x64d/0xdb0 fs/dcache.c:913 lookup_fast+0x3d1/0x6d0 fs/namei.c:1667 walk_component+0xcf/0x6a0 fs/namei.c:2010 link_path_walk.part.0+0x7ef/0xf70 fs/namei.c:2341 link_path_walk fs/namei.c:2266 [inline] path_openat+0x260/0x2930 fs/namei.c:3649 do_filp_open+0x1aa/0x400 fs/namei.c:3680 do_sys_openat2+0x16d/0x4c0 fs/open.c:1308 do_sys_open fs/open.c:1324 [inline] __do_sys_openat fs/open.c:1340 [inline] __se_sys_openat fs/open.c:1335 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1335 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff8880354af8f8 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of 312-byte region [ffff8880354af8f8, ffff8880354afa30) The buggy address belongs to the physical page: page:ffffea0000d52b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880354aed38 pfn:0x354ae head:ffffea0000d52b80 order:1 compound_mapcount:0 compound_pincount:0 memcg:ffff88801bbbea01 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000d5c488 ffffea0001d6d588 ffff888140007780 raw: ffff8880354aed38 000000000015000c 00000001ffffffff ffff88801bbbea01 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 2969, tgid 2969 (udevd), ts 202640478662, free_ts 0 prep_new_page mm/page_alloc.c:2535 [inline] get_page_from_freelist+0x210d/0x3a30 mm/page_alloc.c:4282 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5506 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1824 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x89d/0xef0 mm/slub.c:3031 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3118 slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc_lru+0x528/0x720 mm/slub.c:3275 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc+0x4a/0x230 fs/dcache.c:1849 d_alloc_parallel+0xe7/0x1af0 fs/dcache.c:2601 __lookup_slow+0x193/0x480 fs/namei.c:1686 lookup_slow fs/namei.c:1718 [inline] walk_component+0x40f/0x6a0 fs/namei.c:2014 lookup_last fs/namei.c:2469 [inline] path_lookupat+0x1bb/0x860 fs/namei.c:2493 filename_lookup+0x1c6/0x590 fs/namei.c:2522 user_path_at_empty+0x42/0x60 fs/namei.c:2895 do_readlinkat+0xcd/0x2f0 fs/stat.c:456 page_owner free stack trace missing Memory state around the buggy address: ffff8880354af800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880354af880: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fb >ffff8880354af900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880354af980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880354afa00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fb fb ==================================================================