================================================================== BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline] BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic-fallback.h:1111 [inline] BUG: KASAN: use-after-free in atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline] BUG: KASAN: use-after-free in dst_hold_safe include/net/dst.h:308 [inline] BUG: KASAN: use-after-free in ip6_hold_safe+0xb3/0x3a0 net/ipv6/route.c:1023 Read of size 4 at addr ffff888088e36004 by task kworker/u4:1/25650 CPU: 0 PID: 25650 Comm: kworker/u4:1 Not tainted 5.1.0-rc6+ #187 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:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 kasan_check_read+0x11/0x20 mm/kasan/common.c:102 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline] atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline] atomic_add_unless include/linux/atomic-fallback.h:1111 [inline] atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline] dst_hold_safe include/net/dst.h:308 [inline] ip6_hold_safe+0xb3/0x3a0 net/ipv6/route.c:1023 rt6_get_pcpu_route net/ipv6/route.c:1245 [inline] ip6_pol_route+0x348/0x1040 net/ipv6/route.c:1906 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2082 fib6_rule_lookup+0x128/0x560 net/ipv6/fib6_rules.c:118 ip6_route_output_flags+0x2c4/0x350 net/ipv6/route.c:2111 ip6_route_output include/net/ip6_route.h:88 [inline] icmpv6_xrlim_allow net/ipv6/icmp.c:213 [inline] icmp6_send+0x1150/0x21f0 net/ipv6/icmp.c:541 icmpv6_send+0xee/0x230 net/ipv6/ip6_icmp.c:43 ip6_link_failure+0x2b/0x530 net/ipv6/route.c:2245 dst_link_failure include/net/dst.h:427 [inline] ndisc_error_report+0xd1/0x1c0 net/ipv6/ndisc.c:695 neigh_invalidate+0x24b/0x570 net/core/neighbour.c:995 neigh_timer_handler+0xc35/0xf30 net/core/neighbour.c:1081 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:lock_acquire+0x1ea/0x3f0 kernel/locking/lockdep.c:4214 Code: 7c 08 00 00 00 00 00 00 48 c1 e8 03 80 3c 10 00 0f 85 c7 01 00 00 48 83 3d 42 ff 3a 07 00 0f 84 3b 01 00 00 48 8b 7d c8 57 9d <0f> 1f 44 00 00 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 65 8b RSP: 0018:ffff8880399afb28 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff11252ee RBX: ffff888043004000 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000286 RBP: ffff8880399afb70 R08: 000000003f3e5040 R09: ffffffff895e6a94 R10: ffff8880430048f8 R11: ffff888043004000 R12: ffffffff889a5bc0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000002 rcu_lock_acquire include/linux/rcupdate.h:210 [inline] rcu_read_lock include/linux/rcupdate.h:595 [inline] inet_twsk_purge+0xc0/0x5f0 net/ipv4/inet_timewait_sock.c:267 dccp_v6_exit_batch+0x1a/0x20 net/dccp/ipv6.c:1116 ops_exit_list.isra.0+0x105/0x160 net/core/net_namespace.c:156 cleanup_net+0x3fb/0x960 net/core/net_namespace.c:552 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 3876: 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:3393 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3555 getname_flags fs/namei.c:138 [inline] getname_flags+0xd6/0x5b0 fs/namei.c:128 getname+0x1a/0x20 fs/namei.c:209 do_sys_open+0x2c9/0x5d0 fs/open.c:1063 __do_sys_open fs/open.c:1087 [inline] __se_sys_open fs/open.c:1082 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1082 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 3876: 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:3499 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3765 putname+0xef/0x130 fs/namei.c:259 do_sys_open+0x318/0x5d0 fs/open.c:1078 __do_sys_open fs/open.c:1087 [inline] __se_sys_open fs/open.c:1082 [inline] __x64_sys_open+0x7e/0xc0 fs/open.c:1082 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888088e36800 which belongs to the cache names_cache of size 4096 The buggy address is located 2044 bytes to the left of 4096-byte region [ffff888088e36800, ffff888088e37800) The buggy address belongs to the page: page:ffffea0002238d80 count:1 mapcount:0 mapping:ffff88812c2d8dc0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001af2a88 ffffea0002280e08 ffff88812c2d8dc0 raw: 0000000000000000 ffff888088e36800 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888088e35f00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888088e35f80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc >ffff888088e36000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888088e36080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888088e36100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================