Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Sep 2022 11:58:54 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8707cb19e681 - main - if_vxlan(4): Check the size of data available in mbuf before using them
Message-ID:  <202209301158.28UBwswl033005@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

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

commit 8707cb19e68128c181477d87f960182c14e15f12
Author:     Zhenlei Huang <zlei.huang@gmail.com>
AuthorDate: 2022-09-30 07:55:29 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-09-30 07:56:15 +0000

    if_vxlan(4): Check the size of data available in mbuf before using them
    
    PR:             261711
    Reviewed by:    kp
    Differential Revision:  https://reviews.freebsd.org/D36794
---
 sys/net/if_vxlan.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index 6c9a3d7e3095..cba2ba4b0a16 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -2849,6 +2849,12 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, struct mbuf **m0,
 		return (ENOENT);
 
 	ifp = sc->vxl_ifp;
+	if (m->m_len < ETHER_HDR_LEN &&
+	    (m = m_pullup(m, ETHER_HDR_LEN)) == NULL) {
+		*m0 = NULL;
+		error = ENOBUFS;
+		goto out;
+	}
 	eh = mtod(m, struct ether_header *);
 
 	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209301158.28UBwswl033005>