RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff5ced5a6d4 R13: 00000000004c8a2c R14: 00000000004df7d0 R15: 0000000000000007 ================================================================== BUG: KASAN: use-after-free in atomic_set include/asm-generic/atomic-instrumented.h:44 [inline] BUG: KASAN: use-after-free in refcount_set include/linux/refcount.h:32 [inline] BUG: KASAN: use-after-free in copy_net_ns+0x1b6/0x380 net/core/net_namespace.c:466 Write of size 4 at addr ffff88808d838040 by task syz-executor.0/8045 CPU: 0 PID: 8045 Comm: syz-executor.0 Not tainted 5.2.0-rc6+ #1 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.5+0x9/0x1ff mm/kasan/report.c:188 __kasan_report.cold.6+0x1b/0x39 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/generic.c:191 kasan_check_write+0x14/0x20 mm/kasan/common.c:100 atomic_set include/asm-generic/atomic-instrumented.h:44 [inline] refcount_set include/linux/refcount.h:32 [inline] copy_net_ns+0x1b6/0x380 net/core/net_namespace.c:466 create_new_namespaces+0x487/0x760 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:202 ksys_unshare+0x31b/0x710 kernel/fork.c:2691 __do_sys_unshare kernel/fork.c:2759 [inline] __se_sys_unshare kernel/fork.c:2757 [inline] __x64_sys_unshare+0x2c/0x40 kernel/fork.c:2757 do_syscall_64+0xd0/0x530 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459519 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:00007ff5ced59c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 00007ff5ced59c90 RCX: 0000000000459519 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff5ced5a6d4 R13: 00000000004c8a2c R14: 00000000004df7d0 R15: 0000000000000007 Allocated by task 8045: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.8+0xc7/0xd0 mm/kasan/common.c:489 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:497 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3326 [inline] kmem_cache_alloc+0x11a/0x720 mm/slab.c:3488 kmem_cache_zalloc include/linux/slab.h:732 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0xca/0x380 net/core/net_namespace.c:461 create_new_namespaces+0x487/0x760 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:202 ksys_unshare+0x31b/0x710 kernel/fork.c:2691 __do_sys_unshare kernel/fork.c:2759 [inline] __se_sys_unshare kernel/fork.c:2757 [inline] __x64_sys_unshare+0x2c/0x40 kernel/fork.c:2757 do_syscall_64+0xd0/0x530 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8045: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3698 net_alloc net/core/net_namespace.c:427 [inline] copy_net_ns+0x315/0x380 net/core/net_namespace.c:461 create_new_namespaces+0x487/0x760 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:202 ksys_unshare+0x31b/0x710 kernel/fork.c:2691 __do_sys_unshare kernel/fork.c:2759 [inline] __se_sys_unshare kernel/fork.c:2757 [inline] __x64_sys_unshare+0x2c/0x40 kernel/fork.c:2757 do_syscall_64+0xd0/0x530 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808d838040 which belongs to the cache net_namespace(49:syz0) of size 6784 The buggy address is located 0 bytes inside of 6784-byte region [ffff88808d838040, ffff88808d839ac0) The buggy address belongs to the page: page:ffffea0002360e00 refcount:1 mapcount:0 mapping:ffff88808e58e6c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00020b2188 ffff88808e58f748 ffff88808e58e6c0 raw: 0000000000000000 ffff88808d838040 0000000100000001 ffff888099288b00 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888099288b00 Memory state around the buggy address: ffff88808d837f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88808d837f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808d838000: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88808d838080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d838100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================