================================================================== BUG: KASAN: use-after-free in fib6_drop_pcpu_from net/ipv6/ip6_fib.c:919 [inline] BUG: KASAN: use-after-free in fib6_purge_rt+0x467/0x590 net/ipv6/ip6_fib.c:953 Write of size 8 at addr ffff88809605ca9b by task syz-executor.5/23693 CPU: 0 PID: 23693 Comm: syz-executor.5 Not tainted 5.1.0+ #9 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:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x123/0x190 mm/kasan/generic.c:191 kasan_check_write+0x14/0x20 mm/kasan/common.c:100 fib6_drop_pcpu_from net/ipv6/ip6_fib.c:919 [inline] fib6_purge_rt+0x467/0x590 net/ipv6/ip6_fib.c:953 fib6_del_route net/ipv6/ip6_fib.c:1806 [inline] fib6_del+0xac2/0x10a0 net/ipv6/ip6_fib.c:1837 fib6_clean_node+0x3a8/0x590 net/ipv6/ip6_fib.c:1999 fib6_walk_continue+0x495/0x900 net/ipv6/ip6_fib.c:1921 fib6_walk+0x9d/0x100 net/ipv6/ip6_fib.c:1969 fib6_clean_tree+0xe0/0x120 net/ipv6/ip6_fib.c:2048 __fib6_clean_all+0x118/0x2a0 net/ipv6/ip6_fib.c:2064 fib6_clean_all+0x2b/0x40 net/ipv6/ip6_fib.c:2075 rt6_sync_down_dev+0x134/0x150 net/ipv6/route.c:4153 rt6_disable_ip+0x27/0x5f0 net/ipv6/route.c:4158 addrconf_ifdown+0xa2/0x1220 net/ipv6/addrconf.c:3709 addrconf_notify+0x19a/0x2250 net/ipv6/addrconf.c:3634 notifier_call_chain+0xc7/0x240 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2e/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1753 call_netdevice_notifiers_extack net/core/dev.c:1765 [inline] call_netdevice_notifiers net/core/dev.c:1779 [inline] dev_close_many+0x33f/0x6f0 net/core/dev.c:1522 rollback_registered_many+0x43b/0xfd0 net/core/dev.c:8193 rollback_registered+0x109/0x1d0 net/core/dev.c:8258 unregister_netdevice_queue net/core/dev.c:9305 [inline] unregister_netdevice_queue+0x1ee/0x2c0 net/core/dev.c:9298 unregister_netdevice include/linux/netdevice.h:2635 [inline] __tun_detach+0xd8a/0x1040 drivers/net/tun.c:733 tun_detach drivers/net/tun.c:750 [inline] tun_chr_close+0xe0/0x180 drivers/net/tun.c:3460 __fput+0x302/0x890 fs/file_table.c:279 ____fput+0x16/0x20 fs/file_table.c:312 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x90a/0x2fa0 kernel/exit.c:876 do_group_exit+0x135/0x370 kernel/exit.c:980 __do_sys_exit_group kernel/exit.c:991 [inline] __se_sys_exit_group kernel/exit.c:989 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:989 do_syscall_64+0x103/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458da9 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:00007fff9e767998 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 000000000000001c RCX: 0000000000458da9 RDX: 0000000000412a80 RSI: 0000000000a54ef0 RDI: 0000000000000043 RBP: 00000000004be54c R08: 000000000000000c R09: 00000000001f879f R10: 0000000001573940 R11: 0000000000000246 R12: 00000000ffffffff R13: 00007fff9e767ae0 R14: 00000000001f8716 R15: 00007fff9e767af0 Allocated by task 2815: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3356 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3518 dst_alloc+0x10e/0x200 net/core/dst.c:92 ip6_dst_alloc+0x34/0xa0 net/ipv6/route.c:356 icmp6_dst_alloc+0x1a9/0x660 net/ipv6/route.c:2718 ndisc_send_skb+0xfc6/0x14a0 net/ipv6/ndisc.c:488 ndisc_send_ns+0x3a9/0x860 net/ipv6/ndisc.c:650 rt6_probe_deferred+0xe3/0x1a0 net/ipv6/route.c:543 process_one_work+0x98e/0x1790 kernel/workqueue.c:2268 worker_thread+0x98/0xe40 kernel/workqueue.c:2414 kthread+0x357/0x430 kernel/kthread.c:253 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Freed by task 9485: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3462 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3728 dst_destroy+0x2a0/0x3c0 net/core/dst.c:128 dst_destroy_rcu+0x16/0x19 net/core/dst.c:141 __rcu_reclaim kernel/rcu/rcu.h:227 [inline] rcu_do_batch kernel/rcu/tree.c:2092 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2310 [inline] rcu_core+0x973/0x1430 kernel/rcu/tree.c:2291 __do_softirq+0x266/0x95a kernel/softirq.c:293 The buggy address belongs to the object at ffff88809605ca00 which belongs to the cache ip6_dst_cache of size 224 The buggy address is located 155 bytes inside of 224-byte region [ffff88809605ca00, ffff88809605cae0) The buggy address belongs to the page: page:ffffea0002581700 count:1 mapcount:0 mapping:ffff888216616000 index:0xffff88809605c500 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002671008 ffffea00022dc948 ffff888216616000 raw: ffff88809605c500 ffff88809605c000 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809605c980: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ffff88809605ca00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809605ca80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88809605cb00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff88809605cb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================