aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-07-30 13:41:51 +0000
committerPouria Mousavizadeh Tehrani <pouria@FreeBSD.org>2026-08-02 13:22:28 +0000
commit094ed249e2a2b285f8144db2255079bafff36ca3 (patch)
tree23e298e28946e666ddc52435a35222d31271da1d
parentc60186322fa77ea119c0d015e343611bfa048dc2 (diff)
if_vxlan(4): Fix panic by validating unused drvspec values
Add validation for unused parameter values in the gap between VXLAN_PARAM_WITH_LOCAL_ADDR4 and VXLAN_PARAM_WITH_LOCAL_ADDR6 to prevent panics. PR: 297151 Reported by: Robert Morris <rtm@lcs.mit.edu> Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D58552 (cherry picked from commit c4d7745cd90fc99af3cbccfda7e11798ea7d187b) (cherry picked from commit f923f4739628fc5c80907dad8b69ae9b38269cd0)
-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 ac7c352bac31..bbb0ea6a6c31 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -2310,7 +2310,8 @@ vxlan_ioctl_drvspec(struct vxlan_softc *sc, struct ifdrv *ifd, int get)
} args;
int out, error;
- if (ifd->ifd_cmd >= vxlan_control_table_size)
+ if (ifd->ifd_cmd >= vxlan_control_table_size ||
+ vxlan_control_table[ifd->ifd_cmd].vxlc_func == NULL)
return (EINVAL);
bzero(&args, sizeof(args));