================================================================== BUG: KASAN: use-after-free in inet_ctl_sock_destroy include/net/inet_common.h:56 [inline] BUG: KASAN: use-after-free in icmpv6_sk_exit+0x1a7/0x1c0 net/ipv6/icmp.c:974 Read of size 8 at addr ffff88808a08346c by task syz-executor.0/30754 CPU: 0 PID: 30754 Comm: syz-executor.0 Not tainted 5.2.0-rc1+ #27 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 inet_ctl_sock_destroy include/net/inet_common.h:56 [inline] icmpv6_sk_exit+0x1a7/0x1c0 net/ipv6/icmp.c:974 ops_exit_list.isra.0+0xaa/0x150 net/core/net_namespace.c:154 setup_net+0x400/0x740 net/core/net_namespace.c:333 copy_net_ns+0x1df/0x340 net/core/net_namespace.c:439 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206 ksys_unshare+0x440/0x980 kernel/fork.c:2692 __do_sys_unshare kernel/fork.c:2760 [inline] __se_sys_unshare kernel/fork.c:2758 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459279 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:00007f58e62e7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 0000000000459279 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 000000000075c2e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f58e62e86d4 R13: 00000000004c84b7 R14: 00000000004dec10 R15: 00000000ffffffff Allocated by task 30739: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_slab_alloc+0xf/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/0x6f0 mm/slab.c:3488 sk_prot_alloc+0x67/0x2e0 net/core/sock.c:1602 sk_alloc+0x39/0xf70 net/core/sock.c:1662 inet6_create net/ipv6/af_inet6.c:184 [inline] inet6_create+0x360/0xf80 net/ipv6/af_inet6.c:111 __sock_create+0x3d8/0x730 net/socket.c:1430 sock_create_kern+0x3b/0x50 net/socket.c:1499 inet_ctl_sock_create+0x9d/0x1f0 net/ipv4/af_inet.c:1624 tcpv6_net_init+0x2b/0x30 net/ipv6/tcp_ipv6.c:2034 ops_init+0xb3/0x410 net/core/net_namespace.c:130 setup_net+0x2d3/0x740 net/core/net_namespace.c:316 copy_net_ns+0x1df/0x340 net/core/net_namespace.c:439 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206 ksys_unshare+0x440/0x980 kernel/fork.c:2692 __do_sys_unshare kernel/fork.c:2760 [inline] __se_sys_unshare kernel/fork.c:2758 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 30739: save_stack+0x23/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+0x86/0x260 mm/slab.c:3698 sk_prot_free net/core/sock.c:1643 [inline] __sk_destruct+0x4bc/0x6e0 net/core/sock.c:1731 sk_destruct+0x7b/0x90 net/core/sock.c:1739 __sk_free+0xce/0x300 net/core/sock.c:1750 sk_free+0x42/0x50 net/core/sock.c:1761 sock_put include/net/sock.h:1728 [inline] sk_common_release+0x21c/0x330 net/core/sock.c:3181 rawv6_close+0x68/0x90 net/ipv6/raw.c:1238 inet_release+0xff/0x1e0 net/ipv4/af_inet.c:432 inet6_release+0x53/0x80 net/ipv6/af_inet6.c:474 __sock_release+0x1f4/0x2a0 net/socket.c:607 sock_release+0x18/0x20 net/socket.c:627 inet_ctl_sock_destroy include/net/inet_common.h:56 [inline] tcpv6_net_exit+0x66/0x80 net/ipv6/tcp_ipv6.c:2040 ops_exit_list.isra.0+0xaa/0x150 net/core/net_namespace.c:154 setup_net+0x400/0x740 net/core/net_namespace.c:333 copy_net_ns+0x1df/0x340 net/core/net_namespace.c:439 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206 ksys_unshare+0x440/0x980 kernel/fork.c:2692 __do_sys_unshare kernel/fork.c:2760 [inline] __se_sys_unshare kernel/fork.c:2758 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808a083440 which belongs to the cache RAWv6(17:syz0) of size 1552 The buggy address is located 44 bytes inside of 1552-byte region [ffff88808a083440, ffff88808a083a50) The buggy address belongs to the page: page:ffffea0002282080 refcount:1 mapcount:0 mapping:ffff8880a8b10480 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00019e8088 ffffea00022bef08 ffff8880a8b10480 raw: 0000000000000000 ffff88808a082000 0000000100000004 ffff88806a4fd3c0 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88806a4fd3c0 Memory state around the buggy address: ffff88808a083300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88808a083380: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88808a083400: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88808a083480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808a083500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================