From nobody Wed Jun 17 19:30:04 2026 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 4ggYpn1fQLz6hfYC for ; Wed, 17 Jun 2026 19:30:09 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ggYpn0rcpz3v1N for ; Wed, 17 Jun 2026 19:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781724609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DBH3GT7LGbULskipb/WVou0KY49viixgq+lstT48+C4=; b=HZfSP2jeMOEpsllkThc+8lTMSOLx/y3IQZs1XVFjlAYB2fweb1gA8EjAUSAJezXGjbVzxa Fc7iLsBMKqU0ds2UHKEiW4bctXW1r9MLf3248MWW06v4YR1X2QzfDxEcmQa2c6+mx3wbZj 4YYbMFD3nBNc3443uVZXRvep6Utvz0Gl+ILFh481mtaQ1zfu2G/0u63XH3E7SD1JixQBQ5 6kADbZ55hf0QLO8A7T4v4VjUwA/wnyrdsc62b5GZT1a/zgVYYYPrByizcxHfqcmppjDKrT g675p1difIgAoBXhBLBJqo4O1y0bFIvfPcg3CkxpxIEM3HSWT4mUAtq9yQD8sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781724609; a=rsa-sha256; cv=none; b=J9HtReE+askd6CuhJNWLi8cbTDsPlu2pVbUvv3M0nQ8EwtPusBQMsB0MeO44ee0FWs/UMy uSYn9VgsG426oQXx/W7W4z72ItY15MXYd6gZ2Jgu7+886GGd0/8RrZWu2zCBib3L+2XNPI PGXZUYnS3inQ4VRYzTBIloR1wSsLh/YUMb0Zg/1RQ9qjHJNSU/bQ7jopfx6jIZq4JRN84V fUbjWQ+gUAZJDb45SVzO+hd6qk+5wh8M95Gl97bfT1rPBMb++Qi5A7O7/aJt6Fp1eqU/YT 5J+bT0pGOCTgkejac5c4OszlkmMKt/FE3+KC0Etj9zIw+Chh39IAetENZkmZ2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781724609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DBH3GT7LGbULskipb/WVou0KY49viixgq+lstT48+C4=; b=aodxrIxEQoKcWDyuPKWmVHmSnF7nbhZZ6xPgjhiNR9xwWxi3Y1ylrMBkJJ2iJAaUSJow3j D6bJT/ZLOQkuiJhEmzkxUSvPXBSNr7Mkk7CGPFN7xQxYSVLBPIIBT8daAjXwtCy9AoXqO/ nxckJo9glF+F8nHzgHWwDrszKz4qYtR6aDbMORwKck856Z/eGphr6Py9VmVVxMcPuMfQIf rSmit74oSeg6ZKgkkdMQ7MMc1dTJ6fDXsCb4IubAVdgv24amdc6GZNISAnEBzP1jkQmwFq +FTbMKJvhX7JUpZMvWcmbbrPGv14rGmBqXfvVbvKwFqYORGV6ptA1oFSxezvGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ggYpn09vKz9FX for ; Wed, 17 Jun 2026 19:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3359b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 17 Jun 2026 19:30:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Reid Linnemann From: Kristof Provost Subject: git: e2903636a069 - main - iflib: Fix mbufs leaked by 0 len packets emitted from the if driver 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: e2903636a069d5ef364c8f56452bff5818d15f99 Auto-Submitted: auto-generated Date: Wed, 17 Jun 2026 19:30:04 +0000 Message-Id: <6a32f5bc.3359b.13c9d85d@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e2903636a069d5ef364c8f56452bff5818d15f99 commit e2903636a069d5ef364c8f56452bff5818d15f99 Author: Reid Linnemann AuthorDate: 2026-06-17 18:22:44 +0000 Commit: Kristof Provost CommitDate: 2026-06-17 19:29:31 +0000 iflib: Fix mbufs leaked by 0 len packets emitted from the if driver Some interface drivers, notably bnxt, can insert 0 length packets onto their receive queues when certain conditions are met, such as discarding packets in the case of bnxt. When this packet gets processed by assemble_segments(), The solitary mbuf on the queue that composes it consist of a single zero length fragment. The loop in assemble_segments() doesn't seem to expect that a 0 length fragment can exist in the iri_frags list without a non-zero length header preceding it. In this situation, without filter intervention rxd_frag_to_sd() returns a pointer to the corresponding mbuf in the rxq, where it is matched as a zero-length fragment and immediately discarded without freeing as mh has not yet been assigned. This change corrects this behavior by falling through the mh == NULL case and freeing m on the condition that it is not NULL before continuing the loop. Reviewed by: gallatin Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D57537 --- sys/net/iflib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 0ad805cb7c16..1af9d22db9a2 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2797,14 +2797,14 @@ assemble_segments(iflib_rxq_t rxq, if_rxd_info_t ri, if_rxsd_t sd, int *pf_rv) if (ri->iri_frags[i].irf_len == 0 || consumed || *pf_rv == PFIL_CONSUMED || *pf_rv == PFIL_DROPPED) { if (mh == NULL) { - /* everything saved here */ consumed = true; pf_rv_ptr = NULL; - continue; } /* XXX we can save the cluster here, but not the mbuf */ - m_init(m, M_NOWAIT, MT_DATA, 0); - m_free(m); + if (m != NULL) { + m_init(m, M_NOWAIT, MT_DATA, 0); + m_free(m); + } continue; } if (mh == NULL) {