================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x8f/0xac lib/list_debug.c:26 Read of size 8 at addr ffff88819175abb0 by task kworker/u4:3/105 CPU: 0 PID: 105 Comm: kworker/u4:3 Not tainted 4.20.0-rc6+ #336 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __list_add_valid+0x8f/0xac lib/list_debug.c:26 __list_add include/linux/list.h:60 [inline] list_add_tail include/linux/list.h:93 [inline] neigh_alloc net/core/neighbour.c:395 [inline] ___neigh_create+0x14b7/0x2600 net/core/neighbour.c:553 __neigh_create+0x30/0x40 net/core/neighbour.c:640 ip6_finish_output2+0xa64/0x2940 net/ipv6/ip6_output.c:117 ip6_finish_output+0x58c/0xc60 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x232/0x9d0 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:289 [inline] ip6_xmit+0xf1c/0x24d0 net/ipv6/ip6_output.c:275 inet6_csk_xmit+0x378/0x630 net/ipv6/inet6_connection_sock.c:139 __tcp_transmit_skb+0x1bb7/0x3bb0 net/ipv4/tcp_output.c:1160 tcp_transmit_skb net/ipv4/tcp_output.c:1176 [inline] __tcp_retransmit_skb+0x7bd/0x2dc0 net/ipv4/tcp_output.c:2940 tcp_retransmit_skb+0x2e/0x240 net/ipv4/tcp_output.c:2959 tcp_retransmit_timer+0xca3/0x33d0 net/ipv4/tcp_timer.c:514 tcp_write_timer_handler+0x2e6/0x950 net/ipv4/tcp_timer.c:600 tcp_write_timer+0x111/0x1d0 net/ipv4/tcp_timer.c:620 call_timer_fn+0x272/0x920 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers+0x7e5/0xc70 kernel/time/timer.c:1682 run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1695 __do_softirq+0x308/0xb7e kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x17f/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1cb/0x760 arch/x86/kernel/apic/apic.c:1061 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 RIP: 0010:debug_lockdep_rcu_enabled.part.3+0x44/0x60 kernel/rcu/update.c:250 Code: bb 7c 08 00 00 48 89 fa 48 c1 ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 04 84 d2 75 10 8b 93 7c 08 00 00 31 c0 5b <5d> 85 d2 0f 94 c0 c3 e8 20 64 5a 00 eb e9 0f 1f 40 00 66 2e 0f 1f RSP: 0018:ffff8881d90e7260 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 000000000007ffff RCX: 000000000004a649 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881d90d6d7c RBP: ffff8881d90e7260 R08: ffff8881d90d6500 R09: ffffed103b5c5b5f R10: 0000000000000004 R11: ffff8881dae2dafb R12: 1ffff1103b21ce51 R13: 0000000000000000 R14: ffffffff88c4c880 R15: 000000000000010a debug_lockdep_rcu_enabled+0x77/0x90 kernel/rcu/update.c:248 ___might_sleep+0x84/0x340 kernel/sched/core.c:6113 inet_twsk_purge+0x14e/0x870 net/ipv4/inet_timewait_sock.c:266 dccp_v4_exit_batch+0x1a/0x20 net/dccp/ipv4.c:1033 ops_exit_list.isra.5+0x105/0x160 net/core/net_namespace.c:156 cleanup_net+0x555/0xb10 net/core/net_namespace.c:551 process_one_work+0xc90/0x1c40 kernel/workqueue.c:2153 worker_thread+0x17f/0x1390 kernel/workqueue.c:2296 kthread+0x35a/0x440 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Allocated by task 21: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc mm/slab.c:3722 [inline] __kmalloc+0x15b/0x760 mm/slab.c:3731 kmalloc include/linux/slab.h:551 [inline] kzalloc include/linux/slab.h:741 [inline] neigh_alloc net/core/neighbour.c:375 [inline] ___neigh_create+0x13fc/0x2600 net/core/neighbour.c:553 __neigh_create+0x30/0x40 net/core/neighbour.c:640 ip6_finish_output2+0xa64/0x2940 net/ipv6/ip6_output.c:117 ip6_finish_output+0x58c/0xc60 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x232/0x9d0 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:289 [inline] ip6_xmit+0xf1c/0x24d0 net/ipv6/ip6_output.c:275 inet6_csk_xmit+0x378/0x630 net/ipv6/inet6_connection_sock.c:139 __tcp_transmit_skb+0x1bb7/0x3bb0 net/ipv4/tcp_output.c:1160 tcp_transmit_skb net/ipv4/tcp_output.c:1176 [inline] __tcp_retransmit_skb+0x7bd/0x2dc0 net/ipv4/tcp_output.c:2940 tcp_retransmit_skb+0x2e/0x240 net/ipv4/tcp_output.c:2959 tcp_retransmit_timer+0xca3/0x33d0 net/ipv4/tcp_timer.c:514 tcp_write_timer_handler+0x2e6/0x950 net/ipv4/tcp_timer.c:600 tcp_write_timer+0x111/0x1d0 net/ipv4/tcp_timer.c:620 call_timer_fn+0x272/0x920 kernel/time/timer.c:1326 expire_timers kernel/time/timer.c:1363 [inline] __run_timers+0x7e5/0xc70 kernel/time/timer.c:1682 run_timer_softirq+0x52/0xb0 kernel/time/timer.c:1695 __do_softirq+0x308/0xb7e kernel/softirq.c:292 Freed by task 105: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 __rcu_reclaim kernel/rcu/rcu.h:233 [inline] rcu_do_batch kernel/rcu/tree.c:2437 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2716 [inline] rcu_process_callbacks+0x1140/0x1ac0 kernel/rcu/tree.c:2697 __do_softirq+0x308/0xb7e kernel/softirq.c:292 The buggy address belongs to the object at ffff88819175a940 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 624 bytes inside of 1024-byte region [ffff88819175a940, ffff88819175ad40) The buggy address belongs to the page: page:ffffea000645d680 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0007282188 ffffea0006445788 ffff8881da800ac0 raw: 0000000000000000 ffff88819175a040 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88819175aa80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88819175ab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88819175ab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88819175ac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88819175ac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================