================================================================== BUG: KASAN: use-after-free in l3mdev_master_ifindex_rcu+0xe3/0xf0 net/l3mdev/l3mdev.c:24 Read of size 4 at addr ffff888078d38e5c by task kworker/1:3/7960 CPU: 1 PID: 7960 Comm: kworker/1:3 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_resolve_output+0x472/0x7d0 net/core/neighbour.c:1490 neigh_output include/net/neighbour.h:511 [inline] ip6_finish_output2+0xc68/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] ndisc_send_skb+0xcb6/0x12a0 net/ipv6/ndisc.c:505 ndisc_send_ns+0x2cb/0x7e0 net/ipv6/ndisc.c:647 addrconf_dad_work+0x9dd/0xf60 net/ipv6/addrconf.c:4120 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 8044: 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_sys_sendto net/socket.c:1964 [inline] __se_sys_sendto net/socket.c:1960 [inline] __x64_sys_sendto+0xdc/0x1a0 net/socket.c:1960 do_syscall_64+0xca/0x5d0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8401: 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 __do_sys_sendmsg net/socket.c:2365 [inline] __se_sys_sendmsg net/socket.c:2363 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2363 do_syscall_64+0xca/0x5d0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888078d38c40 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 540 bytes inside of 4096-byte region [ffff888078d38c40, ffff888078d39c40) The buggy address belongs to the page: page:ffffea0001e34e00 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea0001e34c88 ffffea0001e36208 ffff8880aa402000 raw: 0000000000000000 ffff888078d38c40 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888078d38d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078d38d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078d38e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078d38e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078d38f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================