git: f923f4739628 - stable/15 - if_vxlan(4): Fix panic by validating unused drvspec values
Pouria Mousavizadeh Tehrani <[email protected]> Sun, 02 Aug 2026 13:21:00 +0000
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <6a6f443c.25fb2.452af9be__16278.671303165$1785676901$gmane$org@gitrepo.freebsd.org> |
The branch stable/15 has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=f923f4739628fc5c80907dad8b69ae9b38269cd0 commit f923f4739628fc5c80907dad8b69ae9b38269cd0 Author: Pouria Mousavizadeh Tehrani <[email protected]> AuthorDate: 2026-07-30 13:41:51 +0000 Commit: Pouria Mousavizadeh Tehrani <[email protected]> CommitDate: 2026-08-02 13:19:47 +0000 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 <[email protected]> Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D58552 (cherry picked from commit c4d7745cd90fc99af3cbccfda7e11798ea7d187b) --- sys/net/if_vxlan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index fc3d3752e0ae..a9c324724cdc 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -2309,7 +2309,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));