RDX: 00000000200008c0 RSI: 0000000020000800 RDI: 000000002000c100 RBP: 000000000072bea0 R08: 0000000020000940 R09: 0000000000000000 R10: 0000000020000900 R11: 0000000000000246 R12: 0000000000000015 R13: 0000000000000051 R14: 00000000006f2838 R15: 0000000000000028 ================================================================== BUG: KASAN: use-after-free in alloc_pid+0x9a6/0xa00 kernel/pid.c:236 Read of size 4 at addr ffff8801ca9ccd98 by task syz-executor4/17281 CPU: 1 PID: 17281 Comm: syz-executor4 Not tainted 4.16.0-rc7+ #372 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:00007f20cca85c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007f20cca866d4 RCX: 0000000000454e79 RDX: 00000000200008c0 RSI: 0000000020000800 RDI: 000000002000c100 RBP: 000000000072bea0 R08: 0000000020000940 R09: 0000000000000000 R10: 0000000020000900 R11: 0000000000000246 R12: 0000000000000015 R13: 0000000000000051 R14: 00000000006f2838 R15: 0000000000000028 Allocated by task 17281: 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 17298: 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 ffff8801ca9ccd50 which belongs to the cache pid_namespace of size 240 The buggy address is located 72 bytes inside of 240-byte region [ffff8801ca9ccd50, ffff8801ca9cce40) The buggy address belongs to the page: page:ffffea00072a7300 count:1 mapcount:0 mapping:ffff8801ca9cc040 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801ca9cc040 0000000000000000 000000010000000d raw: ffff8801d478c048 ffffea00075ef660 ffff8801d45fd840 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ca9ccc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ca9ccd00: fb fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb >ffff8801ca9ccd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ca9cce00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801ca9cce80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================