================================================================== BUG: KASAN: use-after-free in d_inode include/linux/dcache.h:515 [inline] BUG: KASAN: use-after-free in relay_switch_subbuf+0x837/0x900 kernel/relay.c:676 Read of size 8 at addr ffff88801cea4938 by task ksoftirqd/0/17 CPU: 0 PID: 17 Comm: ksoftirqd/0 Not tainted 6.0.0-rc7-syzkaller-00132-g987a926c1d8a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 d_inode include/linux/dcache.h:515 [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+0xbf8/0xde0 kernel/trace/blktrace.c:268 blk_add_trace_rq+0x384/0x480 kernel/trace/blktrace.c:846 trace_block_rq_complete include/trace/events/block.h:147 [inline] blk_update_request+0x91f/0x1300 block/blk-mq.c:795 blk_mq_end_request+0x4b/0x80 block/blk-mq.c:951 lo_complete_rq+0x1c2/0x280 drivers/block/loop.c:370 blk_complete_reqs+0xad/0xe0 block/blk-mq.c:1022 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 run_ksoftirqd kernel/softirq.c:934 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:926 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 9993: 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:437 [inline] __kasan_slab_alloc+0x85/0xb0 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 mm/slab.c:3294 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc_lru+0x2a3/0x860 mm/slab.c:3498 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc_anon fs/dcache.c:1868 [inline] d_alloc_cursor+0x3b/0xd0 fs/dcache.c:1874 dcache_dir_open+0x33/0x90 fs/libfs.c:82 do_dentry_open+0x4a4/0x13a0 fs/open.c:880 do_open fs/namei.c:3557 [inline] path_openat+0x1c92/0x28f0 fs/namei.c:3691 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 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+0x13f/0x1f0 fs/open.c:1340 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+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 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 dcache_dir_close+0x33/0x40 fs/libfs.c:90 __fput+0x277/0x9d0 fs/file_table.c:320 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+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 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 handle_mounts fs/namei.c:1548 [inline] step_into+0x10bb/0x20d0 fs/namei.c:1831 walk_component+0xf5/0x5a0 fs/namei.c:1999 lookup_last fs/namei.c:2450 [inline] path_lookupat+0x1ba/0x840 fs/namei.c:2474 filename_lookup+0x1ce/0x590 fs/namei.c:2503 vfs_statx+0x148/0x390 fs/stat.c:228 vfs_fstatat+0x8c/0xb0 fs/stat.c:255 __do_sys_newfstatat+0x91/0x110 fs/stat.c:425 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+0x63/0xcd The buggy address belongs to the object at ffff88801cea48d0 which belongs to the cache dentry of size 312 The buggy address is located 104 bytes inside of 312-byte region [ffff88801cea48d0, ffff88801cea4a08) The buggy address belongs to the physical page: page:ffffea000073a900 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801cea4178 pfn:0x1cea4 memcg:ffff888015518401 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000a215c8 ffffea0000a226c8 ffff8880121e1300 raw: ffff88801cea4178 ffff88801cea4000 0000000100000001 ffff888015518401 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x2420d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE|__GFP_RECLAIMABLE), pid 1701, tgid 1701 (kworker/u17:1), ts 20086086586, free_ts 0 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3246 [inline] slab_alloc mm/slab.c:3287 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc_lru+0x727/0x860 mm/slab.c:3498 __d_alloc+0x32/0x960 fs/dcache.c:1769 d_alloc+0x4a/0x230 fs/dcache.c:1849 d_alloc_parallel+0xe4/0x1400 fs/dcache.c:2647 __lookup_slow+0x193/0x460 fs/namei.c:1670 lookup_slow fs/namei.c:1702 [inline] walk_component+0x33f/0x5a0 fs/namei.c:1993 link_path_walk.part.0+0x74e/0xe20 fs/namei.c:2320 link_path_walk fs/namei.c:2245 [inline] path_openat+0x262/0x28f0 fs/namei.c:3687 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_open_execat+0x116/0x730 fs/exec.c:918 bprm_execve fs/exec.c:1812 [inline] bprm_execve+0x48c/0x1960 fs/exec.c:1799 kernel_execve+0x3ea/0x500 fs/exec.c:2002 page_owner free stack trace missing Memory state around the buggy address: ffff88801cea4800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801cea4880: fb fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb >ffff88801cea4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801cea4980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801cea4a00: fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb ==================================================================