From nobody Fri Sep 30 11:58:54 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Mf7zy4tjTz4dgjY; Fri, 30 Sep 2022 11:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mf7zy4MzMz3VyT; Fri, 30 Sep 2022 11:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664539134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uVRE3Qboc60niI8t5EetKYtRLzPsQ9igQ3N8p10s470=; b=togQGt99YeuYwWKO7eDG1vzuAniKx5Iag+vyjs4s2l9jr9kJlPdQBPynwAbDHeQq0PrE8k nVZaX3ynBzIw7Ohu51qxtBwfpQ0GrZvmN4oO01P+Lx8MQb6IJ4tJ0/BLG1teastJcTCtoh HmBqC1VcKW7PDHQGy3nnXMj/jqCMelzRqdtb5It0NWfISYF1w2IUxpHWrMd4As7ZSJln40 DVoW7Ki0IrdjKoLPzZtaDJ81LBh09Thw/d6ZgtqUDcrgsdv7L0V/O1VROd+Lu5mDB1S5w4 UQy82s9zWyM0m5Ge5ZaNwshUkeUtJuD0eic91x+JwDBr68lL6e8rQwjxS5m+2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Mf7zy3DZTz18tb; Fri, 30 Sep 2022 11:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28UBwsjX033006; Fri, 30 Sep 2022 11:58:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28UBwswl033005; Fri, 30 Sep 2022 11:58:54 GMT (envelope-from git) Date: Fri, 30 Sep 2022 11:58:54 GMT Message-Id: <202209301158.28UBwswl033005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8707cb19e681 - main - if_vxlan(4): Check the size of data available in mbuf before using them List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8707cb19e68128c181477d87f960182c14e15f12 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664539134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uVRE3Qboc60niI8t5EetKYtRLzPsQ9igQ3N8p10s470=; b=iQ3nO1yzXqC+Mera4xyf9YOKSZsFCp9QFDdcsr9l8sNyTSos6a+yrwcychAZVa0dOY5pUq FoKSnrp59hOBVWcSADEtyKswtKR3630ZDJDQ972fhRjDzOiJvkSvA81OBNM4m4BwSGZRNN vRmLx3jfuHTXgihTWqKri3sbUN1uPHiWoV0nwdSvgMkCACPVbKk+DM/yr5mO+mT9iqT9J4 k2qO64KeGBJpqESBR3ZIeP3c7Ut+dN9V9SknkSS7nGb575s/J8YKaUqENXnjsT1He24O3X QUO90luIGxRnNqko/ipL0EKsvKNlPGYys1SyPndTO6uNmWAXNMDAcdZW5eveaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664539134; a=rsa-sha256; cv=none; b=Em23Uu1+mKnnGWnymdjSm8FwXMvVko6ITCxO6PaFJeYtx31+gOenZ2ee+caAcxWA1zIWoD gMJcOMqWewDIiW+HEnbZwuJAOB7WQJWtUkHhWX8IByVTPqBXz7L90miyGykdd2cppZcOBb jHG42plOLv16J2H0dZuAx7yyBcNzog/3ZrijdEIDZmyi65HyRPVDCBa/PYOgQ36hu+Lu0y 7DXpmAJ2jxR96k9FlRi7ctHtoyu1kp/KYW2p/m2R5tttkaCT8PMkIsYRBIeji+b/kf19z8 kmYGxY9sGLx6QaV4XTkeZRAJYpd0duG04o189+Tr+cM2QR66rlIw0aeDXZ9UrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8707cb19e68128c181477d87f960182c14e15f12 commit 8707cb19e68128c181477d87f960182c14e15f12 Author: Zhenlei Huang AuthorDate: 2022-09-30 07:55:29 +0000 Commit: Kristof Provost 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) {