================================================================== BUG: KASAN: use-after-free in netif_is_l3_master include/linux/netdevice.h:4707 [inline] BUG: KASAN: use-after-free in l3mdev_master_ifindex_rcu+0xfa/0x130 net/l3mdev/l3mdev.c:24 Read of size 4 at addr ffff88808f3ac21c by task swapper/1/0 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.6.0-rc1-syzkaller #0 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+0x1fb/0x318 lib/dump_stack.c:118 print_address_description+0x74/0x5c0 mm/kasan/report.c:374 __kasan_report+0x149/0x1c0 mm/kasan/report.c:506 kasan_report+0x26/0x50 mm/kasan/common.c:641 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:134 netif_is_l3_master include/linux/netdevice.h:4707 [inline] l3mdev_master_ifindex_rcu+0xfa/0x130 net/l3mdev/l3mdev.c:24 ipv6_dev_get_saddr+0x229/0x9f0 net/ipv6/addrconf.c:1817 ip6_route_get_saddr include/net/ip6_route.h:144 [inline] ip6_dst_lookup_tail+0xe52/0x12b0 net/ipv6/ip6_output.c:1030 ip6_dst_lookup_flow+0x6e/0x110 net/ipv6/ip6_output.c:1153 geneve_get_v6_dst+0x459/0x660 drivers/net/geneve.c:856 geneve6_xmit_skb drivers/net/geneve.c:950 [inline] geneve_xmit+0x71f/0x1f70 drivers/net/geneve.c:1001 __netdev_start_xmit include/linux/netdevice.h:4524 [inline] netdev_start_xmit include/linux/netdevice.h:4538 [inline] xmit_one net/core/dev.c:3470 [inline] dev_hard_start_xmit+0x1b1/0x3f0 net/core/dev.c:3486 __dev_queue_xmit+0x1e1f/0x2e70 net/core/dev.c:4063 dev_queue_xmit+0x17/0x20 net/core/dev.c:4096 neigh_hh_output include/net/neighbour.h:499 [inline] neigh_output include/net/neighbour.h:508 [inline] ip6_finish_output2+0x101d/0x13e0 net/ipv6/ip6_output.c:116 __ip6_finish_output+0x693/0x8c0 net/ipv6/ip6_output.c:142 ip6_finish_output+0x52/0x1e0 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x2c2/0x3c0 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] mld_sendpack+0x770/0xb80 net/ipv6/mcast.c:1682 mld_send_cr net/ipv6/mcast.c:1978 [inline] mld_ifc_timer_expire+0x85b/0xc60 net/ipv6/mcast.c:2477 call_timer_fn+0x95/0x170 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers+0x776/0x970 kernel/time/timer.c:1773 run_timer_softirq+0x4a/0x90 kernel/time/timer.c:1786 __do_softirq+0x283/0x7bd kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x227/0x230 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:546 [inline] smp_apic_timer_interrupt+0x113/0x280 arch/x86/kernel/apic/apic.c:1146 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:native_safe_halt+0x12/0x20 arch/x86/include/asm/irqflags.h:61 Code: 89 d9 80 e1 07 80 c1 03 38 c1 7c ba 48 89 df e8 c4 77 9b f9 eb b0 cc cc 55 48 89 e5 e9 07 00 00 00 0f 00 2d 32 f3 49 00 fb f4 <5d> c3 66 90 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 e9 07 00 00 RSP: 0018:ffffc90000d3fe08 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff1255a5d RBX: ffff8880a99f4340 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: ffffffff812c272a RDI: ffff8880a99f4b84 RBP: ffffc90000d3fe08 R08: ffff8880a99f4b98 R09: ffffed101533e869 R10: ffffed101533e869 R11: 0000000000000000 R12: 1ffff1101533e868 R13: dffffc0000000000 R14: dffffc0000000000 R15: 1ffffffff1255a5b arch_safe_halt arch/x86/include/asm/paravirt.h:144 [inline] default_idle+0x50/0x70 arch/x86/kernel/process.c:695 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:686 default_idle_call+0x59/0xa0 kernel/sched/idle.c:94 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1ec/0x630 kernel/sched/idle.c:269 cpu_startup_entry+0x25/0x30 kernel/sched/idle.c:361 start_secondary+0x384/0x410 arch/x86/kernel/smpboot.c:264 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:242 Allocated by task 8815: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc+0x118/0x1c0 mm/kasan/common.c:515 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 __do_kmalloc_node mm/slab.c:3616 [inline] __kmalloc_node+0x4d/0x60 mm/slab.c:3623 kmalloc_node include/linux/slab.h:578 [inline] kvmalloc_node+0x85/0x110 mm/util.c:574 kvmalloc include/linux/mm.h:645 [inline] kvzalloc include/linux/mm.h:653 [inline] alloc_netdev_mqs+0x8e/0xd40 net/core/dev.c:9797 vti6_init_net+0x112/0x320 net/ipv6/ip6_vti.c:1119 ops_init+0x355/0x430 net/core/net_namespace.c:137 setup_net+0x1eb/0x7f0 net/core/net_namespace.c:327 copy_net_ns+0x334/0x540 net/core/net_namespace.c:468 create_new_namespaces+0x4d7/0x9c0 kernel/nsproxy.c:108 unshare_nsproxy_namespaces+0x12a/0x190 kernel/nsproxy.c:229 ksys_unshare+0x478/0xa00 kernel/fork.c:2955 __do_sys_unshare kernel/fork.c:3023 [inline] __se_sys_unshare kernel/fork.c:3021 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3021 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8815: save_stack mm/kasan/common.c:72 [inline] set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x12e/0x1e0 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10d/0x220 mm/slab.c:3757 __netdev_name_node_alt_destroy net/core/dev.c:322 [inline] netdev_name_node_alt_destroy+0x35c/0x380 net/core/dev.c:334 rtnl_alt_ifname net/core/rtnetlink.c:3518 [inline] rtnl_linkprop+0x42d/0x680 net/core/rtnetlink.c:3567 rtnl_dellinkprop+0x2a/0x40 net/core/rtnetlink.c:3588 rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5438 netlink_rcv_skb+0x19e/0x3e0 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5456 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x766/0x920 net/netlink/af_netlink.c:1328 netlink_sendmsg+0xa2b/0xd40 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg net/socket.c:672 [inline] ____sys_sendmsg+0x4f7/0x7f0 net/socket.c:2343 ___sys_sendmsg net/socket.c:2397 [inline] __sys_sendmsg+0x1ed/0x290 net/socket.c:2430 __do_sys_sendmsg net/socket.c:2439 [inline] __se_sys_sendmsg net/socket.c:2437 [inline] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2437 do_syscall_64+0xf7/0x1c0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88808f3ac000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 540 bytes inside of 4096-byte region [ffff88808f3ac000, ffff88808f3ad000) The buggy address belongs to the page: page:ffffea00023ceb00 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea000268ae88 ffffea000260fd88 ffff8880aa402000 raw: 0000000000000000 ffff88808f3ac000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808f3ac100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f3ac180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808f3ac200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808f3ac280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f3ac300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================