================================================================== BUG: KASAN: use-after-free in inet_ctl_sock_destroy include/net/inet_common.h:56 [inline] BUG: KASAN: use-after-free in tcp_sk_exit+0x20d/0x240 net/ipv4/tcp_ipv4.c:2598 Read of size 8 at addr ffff88806a771be4 by task kworker/u4:8/19268 CPU: 1 PID: 19268 Comm: kworker/u4:8 Not tainted 5.2.0-rc3+ #55 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net 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] tcp_sk_exit+0x20d/0x240 net/ipv4/tcp_ipv4.c:2598 ops_exit_list.isra.0+0xaa/0x150 net/core/net_namespace.c:154 cleanup_net+0x3fb/0x960 net/core/net_namespace.c:553 process_one_work+0x989/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x354/0x420 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 14454: 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:1596 sk_alloc+0x39/0xf70 net/core/sock.c:1656 inet_create net/ipv4/af_inet.c:321 [inline] inet_create+0x36a/0xe00 net/ipv4/af_inet.c:247 __sock_create+0x3d8/0x730 net/socket.c:1424 sock_create net/socket.c:1475 [inline] __sys_socket+0x103/0x220 net/socket.c:1517 __do_sys_socket net/socket.c:1526 [inline] __se_sys_socket net/socket.c:1524 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1524 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 14453: 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:1637 [inline] __sk_destruct+0x4bc/0x6e0 net/core/sock.c:1725 sk_destruct+0x7b/0x90 net/core/sock.c:1733 __sk_free+0xce/0x300 net/core/sock.c:1744 sk_free+0x42/0x50 net/core/sock.c:1755 sock_put include/net/sock.h:1725 [inline] sk_common_release+0x21c/0x330 net/core/sock.c:3180 raw_close+0x22/0x30 net/ipv4/raw.c:704 inet_release+0xe0/0x1f0 net/ipv4/af_inet.c:427 __sock_release+0xce/0x2a0 net/socket.c:601 sock_close+0x1b/0x30 net/socket.c:1273 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 get_signal+0x201b/0x24b0 kernel/signal.c:2434 do_signal+0x87/0x1900 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:279 [inline] do_syscall_64+0x58e/0x680 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88806a771900 which belongs to the cache RAW(87:syz4) of size 1352 The buggy address is located 740 bytes inside of 1352-byte region [ffff88806a771900, ffff88806a771e48) The buggy address belongs to the page: page:ffffea0001a9dc00 refcount:1 mapcount:0 mapping:ffff88809940ec00 index:0xffff88806a771900 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffff88808b321738 ffffea00027b4088 ffff88809940ec00 raw: ffff88806a771900 ffff88806a770100 0000000100000004 ffff8880666993c0 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8880666993c0 Memory state around the buggy address: ffff88806a771a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806a771b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806a771b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806a771c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806a771c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================