================================================================== BUG: KASAN: use-after-free in mqueue_get_tree+0x2ac/0x2e0 ipc/mqueue.c:362 Read of size 8 at addr ffff88015c661354 by task syz-executor2/17737 CPU: 0 PID: 17737 Comm: syz-executor2 Not tainted 4.19.0-rc3-next-20180912+ #72 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+0x1d3/0x2c4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 mqueue_get_tree+0x2ac/0x2e0 ipc/mqueue.c:362 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1787 mq_create_mount+0xe3/0x190 ipc/mqueue.c:415 mq_init_ns+0x15a/0x210 ipc/mqueue.c:1621 create_ipc_ns ipc/namespace.c:58 [inline] copy_ipcs+0x3d2/0x580 ipc/namespace.c:84 create_new_namespaces+0x376/0x900 kernel/nsproxy.c:87 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x79c/0x10b0 kernel/fork.c:2535 __do_sys_unshare kernel/fork.c:2603 [inline] __se_sys_unshare kernel/fork.c:2601 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2601 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459d87 Code: 00 00 00 b8 63 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 3d 8a fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 10 01 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 1d 8a fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffcf6d23568 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459d87 RDX: 0000000000000000 RSI: 00007ffcf6d23570 RDI: 0000000008000000 RBP: 0000000000930b28 R08: 0000000000000000 R09: 0000000000000018 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000010 R13: 0000000000412cc0 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 16681: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 mm/slab.c:3554 kmem_cache_zalloc include/linux/slab.h:697 [inline] net_alloc net/core/net_namespace.c:384 [inline] copy_net_ns+0x15b/0x4a0 net/core/net_namespace.c:424 create_new_namespaces+0x6ad/0x900 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x79c/0x10b0 kernel/fork.c:2535 __do_sys_unshare kernel/fork.c:2603 [inline] __se_sys_unshare kernel/fork.c:2601 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2601 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16681: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x83/0x290 mm/slab.c:3756 net_free net/core/net_namespace.c:400 [inline] net_drop_ns.part.14+0x129/0x150 net/core/net_namespace.c:407 net_drop_ns net/core/net_namespace.c:406 [inline] copy_net_ns+0x39d/0x4a0 net/core/net_namespace.c:444 create_new_namespaces+0x6ad/0x900 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x79c/0x10b0 kernel/fork.c:2535 __do_sys_unshare kernel/fork.c:2603 [inline] __se_sys_unshare kernel/fork.c:2601 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2601 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88015c660040 which belongs to the cache net_namespace(49:syz5) of size 8576 The buggy address is located 4884 bytes inside of 8576-byte region [ffff88015c660040, ffff88015c6621c0) The buggy address belongs to the page: page:ffffea0005719800 count:1 mapcount:0 mapping:ffff8801c17d3940 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801baf4bc48 ffffea00055e3508 ffff8801c17d3940 raw: 0000000000000000 ffff88015c660040 0000000100000001 ffff8801583e2500 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8801583e2500 Memory state around the buggy address: ffff88015c661200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88015c661280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88015c661300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88015c661380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88015c661400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================