================================================================== BUG: KASAN: use-after-free in do_new_mount_fc fs/namespace.c:2770 [inline] BUG: KASAN: use-after-free in do_new_mount fs/namespace.c:2824 [inline] BUG: KASAN: use-after-free in do_mount+0x19a7/0x1bd0 fs/namespace.c:3142 Read of size 8 at addr ffff88808f61b7e8 by task syz-executor.1/15103 CPU: 1 PID: 15103 Comm: syz-executor.1 Not tainted 5.3.0-rc6+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 do_new_mount_fc fs/namespace.c:2770 [inline] do_new_mount fs/namespace.c:2824 [inline] do_mount+0x19a7/0x1bd0 fs/namespace.c:3142 ksys_mount+0xba/0xe0 fs/namespace.c:3351 __do_sys_mount fs/namespace.c:3365 [inline] __se_sys_mount fs/namespace.c:3362 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3362 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459a59 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff2ca5c6c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000459a59 RDX: 0000000020000a40 RSI: 00000000200005c0 RDI: 0000000000000000 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff2ca5c76d4 R13: 00000000004c62a4 R14: 00000000004db438 R15: 00000000ffffffff Allocated by task 15103: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.9+0xc7/0xd0 mm/kasan/common.c:493 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:501 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x750 mm/slab.c:3483 kmem_cache_zalloc include/linux/slab.h:738 [inline] alloc_vfsmnt+0x21/0x620 fs/namespace.c:177 vfs_create_mount+0x8a/0x4b0 fs/namespace.c:940 do_new_mount_fc fs/namespace.c:2760 [inline] do_new_mount fs/namespace.c:2824 [inline] do_mount+0x14c1/0x1bd0 fs/namespace.c:3142 ksys_mount+0xba/0xe0 fs/namespace.c:3351 __do_sys_mount fs/namespace.c:3365 [inline] __se_sys_mount fs/namespace.c:3362 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3362 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x83/0x320 mm/slab.c:3693 free_vfsmnt+0x62/0x80 fs/namespace.c:554 delayed_free_vfsmnt+0xd/0x10 fs/namespace.c:559 __rcu_reclaim kernel/rcu/rcu.h:222 [inline] rcu_do_batch kernel/rcu/tree.c:2114 [inline] rcu_core+0x65e/0x14c0 kernel/rcu/tree.c:2314 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2323 __do_softirq+0x262/0x9a8 kernel/softirq.c:292 The buggy address belongs to the object at ffff88808f61b7c0 which belongs to the cache mnt_cache of size 312 The buggy address is located 40 bytes inside of 312-byte region [ffff88808f61b7c0, ffff88808f61b8f8) The buggy address belongs to the page: page:ffffea00023d86c0 refcount:1 mapcount:0 mapping:ffff8880aa593a80 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002879148 ffffea0002593f48 ffff8880aa593a80 raw: 0000000000000000 ffff88808f61b040 000000010000000a 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808f61b680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f61b700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc >ffff88808f61b780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88808f61b800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f61b880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc ==================================================================