================================================================== BUG: KASAN: use-after-free in d_can_lookup include/linux/dcache.h:402 [inline] BUG: KASAN: use-after-free in link_path_walk+0x10b6/0x1200 fs/namei.c:2140 Read of size 4 at addr ffff8801b5de8160 by task syz-executor4/25549 CPU: 1 PID: 25549 Comm: syz-executor4 Not tainted 4.9.103-g0cecdf8 #38 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff88019254fa38 ffffffff81eb34a9 ffffea0006d77a00 ffff8801b5de8160 0000000000000000 ffff8801b5de8160 ffff88019005c41e ffff88019254fa70 ffffffff815676bb ffff8801b5de8160 0000000000000004 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x6c/0x234 mm/kasan/report.c:256 [] kasan_report_error mm/kasan/report.c:355 [inline] [] kasan_report.cold.6+0x242/0x2fe mm/kasan/report.c:412 [] __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 [] d_can_lookup include/linux/dcache.h:402 [inline] [] link_path_walk+0x10b6/0x1200 fs/namei.c:2140 [] path_parentat.isra.38+0x4e/0x140 fs/namei.c:2338 [] filename_parentat.isra.53.part.54+0x173/0x3d0 fs/namei.c:2360 [] filename_parentat fs/namei.c:3620 [inline] [] filename_create+0xce/0x490 fs/namei.c:3622 [] user_path_create fs/namei.c:3697 [inline] [] SYSC_mkdirat fs/namei.c:3841 [inline] [] SyS_mkdirat fs/namei.c:3833 [inline] [] SYSC_mkdir fs/namei.c:3860 [inline] [] SyS_mkdir+0xb1/0x260 fs/namei.c:3858 [] do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 [] entry_SYSCALL_64_after_swapgs+0x5d/0xdb Allocated by task 25549: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:609 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:547 slab_post_alloc_hook mm/slab.h:417 [inline] slab_alloc_node mm/slub.c:2715 [inline] slab_alloc mm/slub.c:2723 [inline] kmem_cache_alloc+0xbe/0x290 mm/slub.c:2728 __d_alloc+0x2e/0x8f0 fs/dcache.c:1605 d_make_root+0x42/0x90 fs/dcache.c:1894 ramfs_fill_super+0x35d/0x490 fs/ramfs/inode.c:233 mount_nodev+0x5b/0x100 fs/super.c:1146 ramfs_mount+0x2c/0x40 fs/ramfs/inode.c:243 mount_fs+0x28c/0x370 fs/super.c:1206 vfs_kern_mount.part.29+0xd1/0x3d0 fs/namespace.c:991 vfs_kern_mount fs/namespace.c:973 [inline] do_new_mount fs/namespace.c:2513 [inline] do_mount+0x3c9/0x2740 fs/namespace.c:2835 SYSC_mount fs/namespace.c:3051 [inline] SyS_mount+0xfe/0x110 fs/namespace.c:3028 do_syscall_64+0x1a6/0x490 arch/x86/entry/common.c:282 entry_SYSCALL_64_after_swapgs+0x5d/0xdb Freed by task 25552: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kmem_cache_free+0xbe/0x310 mm/slub.c:2980 __d_free fs/dcache.c:265 [inline] dentry_free+0xd5/0x150 fs/dcache.c:341 __dentry_kill+0x33f/0x4c0 fs/dcache.c:586 dentry_kill fs/dcache.c:613 [inline] dput.part.29+0x5cf/0x7b0 fs/dcache.c:830 dput fs/dcache.c:792 [inline] do_one_tree+0x43/0x50 fs/dcache.c:1488 shrink_dcache_for_umount+0x67/0x160 fs/dcache.c:1502 generic_shutdown_super+0x6d/0x300 fs/super.c:422 kill_anon_super fs/super.c:968 [inline] kill_litter_super+0x72/0x90 fs/super.c:978 ramfs_kill_sb+0x3f/0x50 fs/ramfs/inode.c:249 deactivate_locked_super+0x75/0xd0 fs/super.c:310 deactivate_super+0x91/0xd0 fs/super.c:341 cleanup_mnt+0xb2/0x160 fs/namespace.c:1134 __cleanup_mnt+0x16/0x20 fs/namespace.c:1141 task_work_run+0x10c/0x180 kernel/task_work.c:116 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0xfc/0x120 arch/x86/entry/common.c:161 prepare_exit_to_usermode arch/x86/entry/common.c:191 [inline] syscall_return_slowpath arch/x86/entry/common.c:260 [inline] do_syscall_64+0x364/0x490 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_swapgs+0x5d/0xdb The buggy address belongs to the object at ffff8801b5de8160 which belongs to the cache dentry of size 288 The buggy address is located 0 bytes inside of 288-byte region [ffff8801b5de8160, ffff8801b5de8280) The buggy address belongs to the page: page:ffffea0006d77a00 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801b5de8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801b5de8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801b5de8100: 00 00 00 00 fc fc fc fc fc fc fc fc fb fb fb fb ^ ffff8801b5de8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801b5de8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================