================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:360 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596 Read of size 4 at addr ffff888070a28990 by task syz-executor.2/25859 CPU: 1 PID: 25859 Comm: syz-executor.2 Not tainted 5.3.0-rc3+ #164 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+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:612 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 tcp_probe_timer net/ipv4/tcp_timer.c:360 [inline] tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596 tcp_write_timer+0xa8/0x1e0 net/ipv4/tcp_timer.c:612 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1322 expire_timers kernel/time/timer.c:1366 [inline] __run_timers kernel/time/timer.c:1685 [inline] __run_timers kernel/time/timer.c:1653 [inline] run_timer_softirq+0x697/0x17a0 kernel/time/timer.c:1698 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:537 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1095 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:215 [inline] RIP: 0010:test_bit include/asm-generic/bitops-instrumented.h:238 [inline] RIP: 0010:cpumask_test_cpu include/linux/cpumask.h:344 [inline] RIP: 0010:trace_timer_init include/trace/events/timer.h:33 [inline] RIP: 0010:debug_init kernel/time/timer.c:759 [inline] RIP: 0010:init_timer_key+0x8d/0x3a0 kernel/time/timer.c:800 Code: 00 e8 e7 48 10 00 45 89 e4 be 08 00 00 00 4c 89 e0 48 c1 f8 06 48 8d 3c c5 f8 78 a5 89 e8 fb 37 4a 00 4c 0f a3 25 4b 38 43 08 <41> 0f 92 c4 31 ff 44 89 e6 e8 f5 49 10 00 45 84 e4 0f 85 d3 01 00 RSP: 0018:ffff8880a3e47ca0 EFLAGS: 00000247 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: ffff888063951480 RCX: ffffffff816240a5 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff89a578f8 RBP: ffff8880a3e47ce0 R08: 1ffffffff134af1f R09: fffffbfff134af20 R10: fffffbfff134af1f R11: ffffffff89a578ff R12: 0000000000000001 R13: ffffffff860f80f0 R14: ffffffff8b3e01c0 R15: ffff888063950e80 inet_csk_init_xmit_timers+0x3b/0xf0 net/ipv4/inet_connection_sock.c:510 tcp_init_xmit_timers+0x2a/0xb9 net/ipv4/tcp_timer.c:753 tcp_init_sock+0x77/0x960 net/ipv4/tcp.c:415 tcp_v6_init_sock+0x15/0x80 net/ipv6/tcp_ipv6.c:1785 inet6_create net/ipv6/af_inet6.c:253 [inline] inet6_create+0x9c0/0xf70 net/ipv6/af_inet6.c:107 __sock_create+0x3d8/0x730 net/socket.c:1418 sock_create net/socket.c:1469 [inline] __sys_socket+0x103/0x220 net/socket.c:1511 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1518 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c377 Code: 00 00 00 49 89 ca b8 36 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 9a 8c fb ff c3 66 0f 1f 84 00 00 00 00 00 b8 29 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 7d 8c fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fffd54d34a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000029 RAX: ffffffffffffffda RBX: 0000000000710b00 RCX: 000000000045c377 RDX: 0000000000000006 RSI: 0000000000000001 RDI: 000000000000000a RBP: 000000000000185d R08: 0000000000006000 R09: 0000000000004000 R10: 00007fffd54d35d0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffd54d3c70 R14: 0000000000000029 R15: 00007fffd54d3c80 Allocated by task 6455: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 kmem_cache_zalloc include/linux/slab.h:738 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0xf1/0x41f net/core/net_namespace.c:462 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202 ksys_unshare+0x444/0x980 kernel/fork.c:2831 __do_sys_unshare kernel/fork.c:2899 [inline] __se_sys_unshare kernel/fork.c:2897 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2897 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 net_free net/core/net_namespace.c:438 [inline] net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:445 net_drop_ns net/core/net_namespace.c:444 [inline] cleanup_net+0x774/0xa60 net/core/net_namespace.c:613 process_one_work+0x9af/0x1740 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff888070a283c0 which belongs to the cache net_namespace of size 6784 The buggy address is located 1488 bytes inside of 6784-byte region [ffff888070a283c0, ffff888070a29e40) The buggy address belongs to the page: page:ffffea0001c28a00 refcount:1 mapcount:0 mapping:ffff88821b69e1c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00023e3f08 ffffea0002423008 ffff88821b69e1c0 raw: 0000000000000000 ffff888070a283c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888070a28880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888070a28900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888070a28980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888070a28a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888070a28a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================