From nobody Fri Jul 01 08:07:53 2022 X-Original-To: dev-commits-src-all@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 D2BBB8B79DE; Fri, 1 Jul 2022 08:07:53 +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 4LZ79P4qG2z50kB; Fri, 1 Jul 2022 08:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656662873; 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=Uvyv9MAqxFvAn/WdQc7Eo8ZD858LCmwMm82TBnpOLos=; b=oLOWzDulQ9mJZZ1xM7JX5c2ohITO4OsV9PsobkwO1Q0Goqdb4sTF50Wxz64/3tFhh29XPe rp+4TyXinwdjQYy6105od9LeeBmmvn3jQ+GPvAP30L9Upft/IEtW+7HrM137WDm/lpw303 YJz+YuJ2njTAMEATBuszl/9udpnb3By8mcjuFkd2R/jyH52syt1BvTFc4xNoV8YRubEUsp sHOkx+IciOuaPJ3wikI6GkHztnQH+P+patkDBq9YDTgOpiwrthpmu67ZBTpoKiHi1Q2iLg 0iEHJ2Ujv9N2FVh+4aMN+thlvzhDp6Y3b6ZSErLg8DxuHMmr13OSEPx2piJ2aw== 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 6808017AAC; Fri, 1 Jul 2022 08:07:53 +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 26187rsN001351; Fri, 1 Jul 2022 08:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26187r9d001350; Fri, 1 Jul 2022 08:07:53 GMT (envelope-from git) Date: Fri, 1 Jul 2022 08:07:53 GMT Message-Id: <202207010807.26187r9d001350@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: 6c77f8f0e0d8 - main - if_ovpn: handle m_pullup() failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 6c77f8f0e0d8e7984c47ea4d234b724ddd56bb84 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656662873; 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=Uvyv9MAqxFvAn/WdQc7Eo8ZD858LCmwMm82TBnpOLos=; b=Jy377LG2lwXMvI6UugMVaO0p3cAstu59+/v2TT1nj0TKrmSYk2SR3mHYM0IoDANkhGlSgP PxWdxi0hj7yFFsQxnK+Cck1R9IzTSLC0J0ELsVgf8YEzwU/hzi2FKpsL8rCe2bEVbCUqdO C9JHCYUTGyaj6uiNWEF9jGaT0k04O5AcF6IiRRtut3dXiCIDN93NChsP086ep+c43sn8ct 6MfiLOkj9SHBAcn/jB4RkbFWg7Hku3896q+RI1o5Iu47QcfkighpPsIDjFUuadRs12przH rE8leQ/tg2D8Vruv+81NmbKJ9sfG5HKFroQUxhBr71pLdzD7zJU7OOzCnJLkCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656662873; a=rsa-sha256; cv=none; b=Abh9TgI6z22GSYAFK8/uWpY2UvbeiYB744GQAtJZApSQKUrMyCuLKIsisRXhi+xEyVheEn tm3VjIhvBO+Kk6G0ODaSRytwafgN2TeumdU6+GZygABvx2iMyivJ1A3v+BSmBAB7pDlfsu 2n59h3qNMRS3m2SUtkeCVCMk9WeEVFI/ecrzK1c2zes/Pl0R+e8DJN6qh039MRe6RTRBBw 5o9jZn/m73n2+W3+GsPiX41f1btyZxgsSix7vKUxe+XJTZxf7VYkYJnlwY28Nd9IoWmEZH /7KXPUOYWLFYnBvSacwAdIqxH5ZZud+lCZ74W+VgYuZVZvlQUfzl/MFYzTtRrg== 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=6c77f8f0e0d8e7984c47ea4d234b724ddd56bb84 commit 6c77f8f0e0d8e7984c47ea4d234b724ddd56bb84 Author: Kristof Provost AuthorDate: 2022-06-30 18:11:52 +0000 Commit: Kristof Provost CommitDate: 2022-07-01 08:02:32 +0000 if_ovpn: handle m_pullup() failure Ensure we correctly handle m_pullup() failing in ovpn_finish_rx(). Reported by: Coverity (CID 1490340) Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 87798c974442..9430d1cebe56 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -1441,6 +1441,10 @@ ovpn_finish_rx(struct ovpn_softc *sc, struct mbuf *m, /* Ensure we can read the first byte. */ m = m_pullup(m, 1); + if (m == NULL) { + OVPN_COUNTER_ADD(sc, nomem_data_pkts_in, 1); + return; + } /* * Check for address family, and disregard any control packets (e.g.