================================================================== 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 ffff88806bfb48e8 by task kworker/u4:20/12269 CPU: 0 PID: 12269 Comm: kworker/u4:20 Not tainted 5.1.0-rc5+ #150 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: bat_events batadv_nc_worker 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 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1027 do_softirq.part.0+0x11a/0x170 kernel/softirq.c:338 do_softirq kernel/softirq.c:330 [inline] __local_bh_enable_ip+0x211/0x270 kernel/softirq.c:190 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:176 [inline] _raw_spin_unlock_bh+0x31/0x40 kernel/locking/spinlock.c:200 spin_unlock_bh include/linux/spinlock.h:374 [inline] batadv_nc_purge_paths+0x267/0x370 net/batman-adv/network-coding.c:470 batadv_nc_worker+0x29c/0x760 net/batman-adv/network-coding.c:719 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 Allocated by task 7771: 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 13971: 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 ffff88806bfb4180 which belongs to the cache net_namespace of size 8640 The buggy address is located 1896 bytes inside of 8640-byte region [ffff88806bfb4180, ffff88806bfb6340) The buggy address belongs to the page: page:ffffea0001afed00 count:1 mapcount:0 mapping:ffff88821bc45e00 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001bb8d08 ffffea000189d708 ffff88821bc45e00 raw: 0000000000000000 ffff88806bfb4180 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88806bfb4780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806bfb4800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88806bfb4880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806bfb4900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806bfb4980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================