loop1: detected capacity change from 0 to 264192 ================================================================== BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:515 [inline] BUG: KASAN: use-after-free in relay_switch_subbuf+0x298/0x6b0 kernel/relay.c:676 Read of size 8 at addr ffff888084da4648 by task syz-executor.1/17915 CPU: 0 PID: 17915 Comm: syz-executor.1 Not tainted 6.0.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report+0xfb/0x130 mm/kasan/report.c:495 d_inode include/linux/dcache.h:515 [inline] relay_switch_subbuf+0x298/0x6b0 kernel/relay.c:676 relay_reserve include/linux/relay.h:248 [inline] trace_note+0x54b/0x6f0 kernel/trace/blktrace.c:95 trace_note_tsk+0xb9/0x150 kernel/trace/blktrace.c:126 __blk_add_trace+0x9ef/0xd60 kernel/trace/blktrace.c:268 blk_add_trace_bio+0x234/0x280 kernel/trace/blktrace.c:905 trace_block_bio_queue+0x1cf/0x220 include/trace/events/block.h:355 submit_bio_noacct+0xe71/0x1780 block/blk-core.c:790 submit_bio+0x23c/0x3a0 block/blk-core.c:848 submit_bh fs/buffer.c:2725 [inline] __bread_slow fs/buffer.c:1177 [inline] __bread_gfp+0x17e/0x320 fs/buffer.c:1381 sb_bread include/linux/buffer_head.h:339 [inline] fat_fill_super+0x1b5f/0x4a70 fs/fat/inode.c:1651 mount_bdev+0x26c/0x3a0 fs/super.c:1400 legacy_get_tree+0xea/0x180 fs/fs_context.c:610 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x289/0xad0 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fc04c28bada 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:00007fc04d444f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000180 RCX: 00007fc04c28bada RDX: 00000000200000c0 RSI: 00000000200003c0 RDI: 00007fc04d444fe0 RBP: 00007fc04d445020 R08: 00007fc04d445020 R09: 00000000200000c0 R10: 0000000002010080 R11: 0000000000000202 R12: 00000000200000c0 R13: 00000000200003c0 R14: 00007fc04d444fe0 R15: 00000000200002c0 Allocated by task 14427: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3248 [inline] slab_alloc mm/slub.c:3256 [inline] __kmem_cache_alloc_lru mm/slub.c:3263 [inline] kmem_cache_alloc_lru+0x175/0x2d0 mm/slub.c:3280 __d_alloc+0x31/0x700 fs/dcache.c:1769 d_alloc_pseudo+0x19/0x70 fs/dcache.c:1899 alloc_file_pseudo+0x137/0x300 fs/file_table.c:265 sock_alloc_file+0xb4/0x240 net/socket.c:463 sock_map_fd net/socket.c:487 [inline] __sys_socket+0x1cb/0x3a0 net/socket.c:1644 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 14427: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kmem_cache_free+0x95/0x1d0 mm/slub.c:3556 __dentry_kill+0x46b/0x5b0 fs/dcache.c:621 dentry_kill+0xbb/0x290 dput+0x1f3/0x410 fs/dcache.c:913 __fput+0x5a8/0x820 fs/file_table.c:333 task_work_run+0x146/0x1c0 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x134/0x160 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:2793 __dentry_kill+0x46b/0x5b0 fs/dcache.c:621 shrink_dentry_list+0x386/0x6c0 fs/dcache.c:1201 shrink_dcache_parent+0xcd/0x450 d_invalidate+0xef/0x2a0 fs/dcache.c:1737 proc_invalidate_siblings_dcache+0x398/0x630 fs/proc/inode.c:148 release_task+0x15a0/0x1890 kernel/exit.c:226 wait_task_zombie kernel/exit.c:1111 [inline] wait_consider_task+0x196c/0x2cd0 kernel/exit.c:1338 do_wait_thread kernel/exit.c:1401 [inline] do_wait+0x291/0x9d0 kernel/exit.c:1518 kernel_wait4+0x29c/0x3e0 kernel/exit.c:1681 __do_sys_wait4 kernel/exit.c:1709 [inline] __se_sys_wait4 kernel/exit.c:1705 [inline] __x64_sys_wait4+0x130/0x1e0 kernel/exit.c:1705 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:2793 __dentry_kill+0x46b/0x5b0 fs/dcache.c:621 dentry_kill+0xbb/0x290 dput+0x1f3/0x410 fs/dcache.c:913 handle_mounts fs/namei.c:1548 [inline] step_into+0x441/0x1060 fs/namei.c:1831 open_last_lookups fs/namei.c:3504 [inline] path_openat+0x174c/0x2e00 fs/namei.c:3688 do_filp_open+0x275/0x500 fs/namei.c:3718 do_sys_openat2+0x13b/0x500 fs/open.c:1313 do_sys_open fs/open.c:1329 [inline] __do_sys_openat fs/open.c:1345 [inline] __se_sys_openat fs/open.c:1340 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888084da45e0 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of 312-byte region [ffff888084da45e0, ffff888084da4718) The buggy address belongs to the physical page: page:ffffea0002136900 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x84da4 head:ffffea0002136900 order:1 compound_mapcount:0 compound_pincount:0 memcg:ffff88807dafff01 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff8880121db780 raw: 0000000000000000 0000000000150015 00000001ffffffff ffff88807dafff01 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 8390, tgid 8389 (syz-executor.1), ts 458522519734, free_ts 366458640540 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0x70/0xf0 mm/slub.c:1829 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] __kmem_cache_alloc_lru mm/slub.c:3263 [inline] kmem_cache_alloc_lru+0x225/0x2d0 mm/slub.c:3280 __d_alloc+0x31/0x700 fs/dcache.c:1769 d_alloc fs/dcache.c:1849 [inline] d_alloc_parallel+0xcb/0x12c0 fs/dcache.c:2647 __lookup_slow+0x112/0x3e0 fs/namei.c:1670 lookup_one_len+0x430/0x690 fs/namei.c:2711 start_creating+0x183/0x330 fs/debugfs/inode.c:352 __debugfs_create_file+0x74/0x500 fs/debugfs/inode.c:397 kvm_create_vm_debugfs+0x701/0x9d0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1086 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1223 [inline] kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4912 [inline] kvm_dev_ioctl+0x1350/0x17f0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4954 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3476 free_slab mm/slub.c:2073 [inline] discard_slab mm/slub.c:2079 [inline] __unfreeze_partials+0x1ab/0x200 mm/slub.c:2553 put_cpu_partial+0x116/0x180 mm/slub.c:2629 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3248 [inline] __kmalloc_node+0x1f9/0x420 mm/slub.c:4473 kmalloc_node include/linux/slab.h:623 [inline] kvmalloc_node+0x6e/0x180 mm/util.c:613 kvmalloc include/linux/slab.h:750 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x1f6/0xd30 fs/seq_file.c:210 call_read_iter include/linux/fs.h:2181 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7cf/0xbc0 fs/read_write.c:470 ksys_read+0x19b/0x2c0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888084da4500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888084da4580: fb fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb >ffff888084da4600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888084da4680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888084da4700: fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb ==================================================================