Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jul 2026 14:13:05 +0000
From:      Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c4d7745cd90f - main - if_vxlan(4): Fix panic by validating unused drvspec values
Message-ID:  <6a6b5bf1.1e9dd.314b513e@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by pouria:

URL: https://cgit.FreeBSD.org/src/commit/?id=c4d7745cd90fc99af3cbccfda7e11798ea7d187b

commit c4d7745cd90fc99af3cbccfda7e11798ea7d187b
Author:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
AuthorDate: 2026-07-30 13:41:51 +0000
Commit:     Pouria Mousavizadeh Tehrani <pouria@FreeBSD.org>
CommitDate: 2026-07-30 14:10:36 +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 <rtm@lcs.mit.edu>
    Reviewed by:    markj
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D58552
---
 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 da219217480f..e69f8e1f75a1 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));


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a6b5bf1.1e9dd.314b513e>