================================================================== BUG: KASAN: use-after-free in alloc_pid+0x9a6/0xa00 kernel/pid.c:236 Read of size 4 at addr ffff8801cff8a418 by task syz-executor7/29125 CPU: 1 PID: 29125 Comm: syz-executor7 Not tainted 4.16.0-rc7+ #7 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x24d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 alloc_pid+0x9a6/0xa00 kernel/pid.c:236 copy_process.part.38+0x2516/0x4bd0 kernel/fork.c:1807 copy_process kernel/fork.c:1606 [inline] _do_fork+0x1f7/0xf70 kernel/fork.c:2087 SYSC_clone kernel/fork.c:2194 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2188 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x454e79 RSP: 002b:00007ff62b096c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007ff62b0976d4 RCX: 0000000000454e79 RDX: 00000000209c4ffc RSI: 0000000020e69000 RDI: 0000000030000100 RBP: 000000000072bea0 R08: 0000000020a46000 R09: 0000000000000000 R10: 00000000201cc000 R11: 0000000000000246 R12: 0000000000000014 R13: 0000000000000051 R14: 00000000006f2838 R15: 000000000000002d Allocated by task 29125: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3542 kmem_cache_zalloc include/linux/slab.h:691 [inline] create_pid_namespace kernel/pid_namespace.c:116 [inline] copy_pid_ns+0x257/0xc60 kernel/pid_namespace.c:175 create_new_namespaces+0x307/0x880 kernel/nsproxy.c:94 copy_namespaces+0x340/0x400 kernel/nsproxy.c:165 copy_process.part.38+0x2380/0x4bd0 kernel/fork.c:1796 copy_process kernel/fork.c:1606 [inline] _do_fork+0x1f7/0xf70 kernel/fork.c:2087 SYSC_clone kernel/fork.c:2194 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2188 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 4493: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3486 [inline] kmem_cache_free+0x83/0x2a0 mm/slab.c:3744 delayed_free_pidns+0x82/0xb0 kernel/pid_namespace.c:157 __rcu_reclaim kernel/rcu/rcu.h:172 [inline] rcu_do_batch kernel/rcu/tree.c:2674 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2933 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2900 [inline] rcu_process_callbacks+0xd6c/0x17f0 kernel/rcu/tree.c:2917 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801cff8a3d0 which belongs to the cache pid_namespace of size 240 The buggy address is located 72 bytes inside of 240-byte region [ffff8801cff8a3d0, ffff8801cff8a4c0) The buggy address belongs to the page: page:ffffea00073fe280 count:1 mapcount:0 mapping:ffff8801cff8a040 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801cff8a040 0000000000000000 000000010000000d raw: ffffea00070ba0e0 ffff8801d4036748 ffff8801d4eec080 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cff8a300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cff8a380: fb fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb >ffff8801cff8a400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cff8a480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801cff8a500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================