IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in l3mdev_master_ifindex_rcu+0xe3/0xf0 net/l3mdev/l3mdev.c:24 Read of size 4 at addr ffff8880804cac5c by task kworker/0:2/3043 CPU: 0 PID: 3043 Comm: kworker/0:2 Not tainted 5.3.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: ipv6_addrconf addrconf_dad_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x113/0x167 lib/dump_stack.c:113 print_address_description.constprop.8.cold.10+0x9/0x31d mm/kasan/report.c:374 __kasan_report.cold.11+0x1b/0x3a mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 l3mdev_master_ifindex_rcu+0xe3/0xf0 net/l3mdev/l3mdev.c:24 ipv6_dev_get_saddr+0x60a/0x990 net/ipv6/addrconf.c:1817 ip6_route_get_saddr include/net/ip6_route.h:144 [inline] ip6_dst_lookup_tail+0xe9f/0x1980 net/ipv6/ip6_output.c:1027 ip6_dst_lookup+0x32/0x60 net/ipv6/ip6_output.c:1129 geneve_get_v6_dst+0x3ca/0xa90 drivers/net/geneve.c:856 geneve6_xmit_skb drivers/net/geneve.c:948 [inline] geneve_xmit+0x230/0x3230 drivers/net/geneve.c:999 __netdev_start_xmit include/linux/netdevice.h:4430 [inline] netdev_start_xmit include/linux/netdevice.h:4444 [inline] xmit_one net/core/dev.c:3388 [inline] dev_hard_start_xmit+0x16a/0x780 net/core/dev.c:3404 __dev_queue_xmit+0x20b9/0x3050 net/core/dev.c:3981 dev_queue_xmit+0xb/0x10 net/core/dev.c:4014 neigh_hh_output include/net/neighbour.h:500 [inline] neigh_output include/net/neighbour.h:509 [inline] ip6_finish_output2+0xc34/0x22f0 net/ipv6/ip6_output.c:116 __ip6_finish_output+0x36c/0x930 net/ipv6/ip6_output.c:142 ip6_finish_output+0x27/0x170 net/ipv6/ip6_output.c:152 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip6_output+0x1bf/0x630 net/ipv6/ip6_output.c:175 dst_output include/net/dst.h:436 [inline] NF_HOOK include/linux/netfilter.h:305 [inline] mld_sendpack+0x870/0xcb0 net/ipv6/mcast.c:1682 mld_send_initial_cr.part.32+0xd7/0x110 net/ipv6/mcast.c:2099 mld_send_initial_cr net/ipv6/mcast.c:2112 [inline] ipv6_mc_dad_complete+0x14d/0x1a0 net/ipv6/mcast.c:2106 addrconf_dad_completed+0x86f/0xbb0 net/ipv6/addrconf.c:4176 addrconf_dad_work+0x63c/0xf60 net/ipv6/addrconf.c:4107 process_one_work+0x856/0x1630 kernel/workqueue.c:2269 worker_thread+0x85/0xb60 kernel/workqueue.c:2415 kthread+0x331/0x3f0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 8212: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.13+0xc7/0xd0 mm/kasan/common.c:510 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524 __do_kmalloc_node mm/slab.c:3615 [inline] __kmalloc_node+0x4d/0x70 mm/slab.c:3622 kmalloc_node include/linux/slab.h:595 [inline] kvmalloc_node+0x6a/0x80 mm/util.c:564 kvmalloc include/linux/mm.h:670 [inline] kvzalloc include/linux/mm.h:678 [inline] alloc_netdev_mqs+0x5d/0xbf0 net/core/dev.c:9311 rtnl_create_link+0x1e2/0xb90 net/core/rtnetlink.c:2934 __rtnl_newlink+0xbd0/0x1400 net/core/rtnetlink.c:3189 rtnl_newlink+0x61/0x90 net/core/rtnetlink.c:3257 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:5323 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:5341 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x43b/0x640 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x74b/0xbf0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:657 __sys_sendto+0x1f2/0x2e0 net/socket.c:1952 __do_compat_sys_socketcall net/compat.c:771 [inline] __se_compat_sys_socketcall net/compat.c:719 [inline] __ia32_compat_sys_socketcall+0x473/0x610 net/compat.c:719 do_syscall_32_irqs_on arch/x86/entry/common.c:333 [inline] do_fast_syscall_32+0x235/0xb3b arch/x86/entry/common.c:404 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 8549: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3425 [inline] kfree+0x108/0x2c0 mm/slab.c:3756 __netdev_name_node_alt_destroy+0x1d0/0x270 net/core/dev.c:321 netdev_name_node_alt_destroy+0x43/0x70 net/core/dev.c:333 rtnl_alt_ifname net/core/rtnetlink.c:3400 [inline] rtnl_linkprop.isra.32+0x4e8/0x630 net/core/rtnetlink.c:3452 rtnl_dellinkprop+0x40/0x60 net/core/rtnetlink.c:3473 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:5323 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:5341 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x43b/0x640 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x74b/0xbf0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:657 ___sys_sendmsg+0x647/0x950 net/socket.c:2311 __sys_sendmsg+0xd9/0x180 net/socket.c:2356 __compat_sys_sendmsg net/compat.c:642 [inline] __do_compat_sys_sendmsg net/compat.c:649 [inline] __se_compat_sys_sendmsg net/compat.c:646 [inline] __ia32_compat_sys_sendmsg+0x75/0xb0 net/compat.c:646 do_syscall_32_irqs_on arch/x86/entry/common.c:333 [inline] do_fast_syscall_32+0x235/0xb3b arch/x86/entry/common.c:404 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8880804caa40 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 540 bytes inside of 4096-byte region [ffff8880804caa40, ffff8880804cba40) The buggy address belongs to the page: page:ffffea0002013280 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00024d7208 ffffea00024ec088 ffff8880aa402000 raw: 0000000000000000 ffff8880804caa40 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880804cab00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880804cab80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880804cac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880804cac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880804cad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================