================================================================== BUG: KASAN: use-after-free in tcp_orphan_retries net/ipv4/tcp_timer.c:127 [inline] BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:362 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x889/0x8a0 net/ipv4/tcp_timer.c:591 Read of size 4 at addr ffff888088cd8aa8 by task syz-executor.0/31384 CPU: 1 PID: 31384 Comm: syz-executor.0 Not tainted 5.1.0-rc5+ #149 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:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 tcp_orphan_retries net/ipv4/tcp_timer.c:127 [inline] tcp_probe_timer net/ipv4/tcp_timer.c:362 [inline] tcp_write_timer_handler+0x889/0x8a0 net/ipv4/tcp_timer.c:591 tcp_write_timer+0x10e/0x1d0 net/ipv4/tcp_timer.c:607 call_timer_fn+0x190/0x720 kernel/time/timer.c:1325 expire_timers kernel/time/timer.c:1362 [inline] __run_timers kernel/time/timer.c:1681 [inline] __run_timers kernel/time/timer.c:1649 [inline] run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694 __do_softirq+0x266/0x95a kernel/softirq.c:293 invoke_softirq kernel/softirq.c:374 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:414 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:767 [inline] RIP: 0010:console_unlock+0xb82/0xed0 kernel/printk/printk.c:2460 Code: 92 88 48 c1 e8 03 42 80 3c 30 00 0f 85 e4 02 00 00 48 83 3d 8f fa 37 07 00 0f 84 91 01 00 00 e8 a4 f0 15 00 48 8b 7d 98 57 9d <0f> 1f 44 00 00 e9 6b ff ff ff e8 8f f0 15 00 48 8b 7d 08 c7 05 11 RSP: 0018:ffff88806c6cf338 EFLAGS: 00000212 ORIG_RAX: ffffffffffffff13 RAX: 0000000000040000 RBX: 0000000000000200 RCX: ffffc9000a42a000 RDX: 0000000000008a1f RSI: ffffffff815a9c2c RDI: 0000000000000212 RBP: ffff88806c6cf3c0 R08: ffff8880a955c380 R09: ffff8880a955cc48 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffffffff842164e0 R14: dffffc0000000000 R15: ffffffff88f91230 vprintk_emit+0x280/0x6d0 kernel/printk/printk.c:1975 vprintk_default+0x28/0x30 kernel/printk/printk.c:2002 vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398 printk+0xba/0xed kernel/printk/printk.c:2035 __nla_parse.cold+0x24/0x37 lib/nlattr.c:425 nla_parse+0x45/0x60 lib/nlattr.c:439 nlmsg_parse include/net/netlink.h:531 [inline] tc_ctl_tclass+0x206/0xcd0 net/sched/sch_api.c:1975 rtnetlink_rcv_msg+0x465/0xb00 net/core/rtnetlink.c:5195 netlink_rcv_skb+0x17a/0x460 net/netlink/af_netlink.c:2486 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5213 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1926 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:661 ___sys_sendmsg+0x806/0x930 net/socket.c:2279 __sys_sendmsg+0x105/0x1d0 net/socket.c:2317 __do_sys_sendmsg net/socket.c:2326 [inline] __se_sys_sendmsg net/socket.c:2324 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2324 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458c29 Code: ad b8 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 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff930152c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458c29 RDX: 0000000000000000 RSI: 0000000020000700 RDI: 0000000000000003 RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff9301536d4 R13: 00000000004c6120 R14: 00000000004da8f8 R15: 00000000ffffffff Allocated by task 5277: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3394 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3556 kmem_cache_zalloc include/linux/slab.h:732 [inline] net_alloc net/core/net_namespace.c:385 [inline] copy_net_ns+0xed/0x340 net/core/net_namespace.c:425 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:2549 __do_sys_unshare kernel/fork.c:2617 [inline] __se_sys_unshare kernel/fork.c:2615 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2615 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 24923: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3500 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3766 net_free net/core/net_namespace.c:401 [inline] net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:408 net_drop_ns net/core/net_namespace.c:407 [inline] cleanup_net+0x538/0x960 net/core/net_namespace.c:570 process_one_work+0x98e/0x1790 kernel/workqueue.c:2269 worker_thread+0x98/0xe40 kernel/workqueue.c:2415 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff888088cd8340 which belongs to the cache net_namespace of size 8640 The buggy address is located 1896 bytes inside of 8640-byte region [ffff888088cd8340, ffff888088cda500) The buggy address belongs to the page: page:ffffea0002233600 count:1 mapcount:0 mapping:ffff88821bc45e00 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00015f0408 ffffea0002173b08 ffff88821bc45e00 raw: 0000000000000000 ffff888088cd8340 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888088cd8980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888088cd8a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888088cd8a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888088cd8b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888088cd8b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================