summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2022-02-21 05:19:08 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2022-02-21 05:19:08 +0000
commit8a8ba12f65c6e12a07f0e8ff38e503d8ddfdcb9d (patch)
tree077f05e6a7d369758c692aec89ecf097d6262d36 /sys/net
parent346933e7fad5ec46968ad7a4e18d7f54da58a857 (diff)
in input, clear the address union before putting an ipv4 address in it.
the whole vxlan address is used for lookups in the RB tree, so any garbage on the stack where the address sits could confuse the lookup. it looks like i was lucky before, but if you receive vxlan over ipsec you are less lucky. found by and fix tested by jason tubnor.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_vxlan.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index e6687e9230e..c8d3bc48cd6 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vxlan.c,v 1.88 2022/02/18 03:22:27 dlg Exp $ */
+/* $OpenBSD: if_vxlan.c,v 1.89 2022/02/21 05:19:07 dlg Exp $ */
/*
* Copyright (c) 2021 David Gwynne <dlg@openbsd.org>
@@ -633,6 +633,7 @@ vxlan_input(void *arg, struct mbuf *m, struct ip *ip, struct ip6_hdr *ip6,
port = uh->uh_sport;
if (ip != NULL) {
+ memset(&addr, 0, sizeof(addr));
addr.in4 = ip->ip_src;
tos = ip->ip_tos;
}