From nobody Thu Jul 9 16:10:06 2026 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 4gx0Kq3Nfjz6kRmf for ; Thu, 09 Jul 2026 16:10:07 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gx0Kq028xz3V0X for ; Thu, 09 Jul 2026 16:10:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783613407; 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=W2xBQbMERwod3gLqm6F7LfI8TedUsCcFCxUhrbDsOYo=; b=cp+kJEeToSmAwCzELLFPjRziF9PubzJMBWUdVXjRaKn6i3H8rCoPq4pDyVclRMfUB1bap9 n86v8CcyI+zMuN3jmitEvwc+eFcSqM+E+Q0E8SjWHwWU1vbLVcUdLeIJmEysYEW6Y/ByIi hi3Ik4bCZwdmORaOoB1islJfX7s0D1ehVonxLKPIeWh2muWV1qswL28lA3iCoAaPeVfSVI e66PfYcZ+efv0xVDepEfd3rPg/VpF8N2IYFVUQqTHWFSDhPu0Sh5O8Ej+4YBeobISL0M0y A5gPxyES5duWdyFIUZ7zonLuE/1gJpNT5KBwYEWh8iajJd9dkkOjN02crRbw0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783613407; a=rsa-sha256; cv=none; b=Ib42VJ8ZLuw+LaPM7XeOEwmEbQQaM0mXj/oq+T6oT9P95BKexWKaWkXbL2gUCzPimf4ljh ueT82QCO0/ffwb6fPpVxvpE1P2j91sECwEHAQiAKUvD4nN6/+aYm+ZZPr19DqRYvWMrJTV manNwmNcgWcrfDN4piRS/mipQTKbRF+avu+/5ArRoJGNZEREI9KqmYPsfkTCKqKu1Or+NG 6x3ya7IafSVVU7sh7oeQlZURfGt8SstLB21kXuu6loic29yAMaFP+eCcwcXUPDdrUAZXz4 eWdHdjpZX/EDTWC9ktlXmfR3hKUcWNhegI9zg7/gWT9vQCnQ6r0tR+lP9FLHDA== 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=1783613407; 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=W2xBQbMERwod3gLqm6F7LfI8TedUsCcFCxUhrbDsOYo=; b=s8v1XwZL/eu4NY6efDWBC/Dy98y0dXUpzxlYUASsIna7YDzvQgPT9bhdEBmSCYmclXL6aJ ljN7r5G81uc2lU9X95+2JSnFWKpRfOeW0mjegZSc3iyKRUiu5N0dr2AwBCu4Fv5Yp7BgsA UqXs4uAZDY/XYUrdrOUo8b+auAJVEzzqK3NH3ZBKYDbSMHABljHqynOFzlc5JvPKvVbVoo e6rRa+Um8BXfHShWL/4E6WmB1MExQK9Ph/wq8nZ2Y0bdU0mii+bAAADCDU+t82CZjjUoMW raar+4hu0x+lNAba8Zq8pxMDsGsDLu+62Xa38+qTDri7iTGXEEISWwnncerJqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gx0Kp5yswz115 for ; Thu, 09 Jul 2026 16:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37ac3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 09 Jul 2026 16:10:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f8e499fb0fc8 - stable/15 - ipfw nat: Add assertion that mbuf is not a chain 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f8e499fb0fc80f1e74a6a5b474beff9250c2fe43 Auto-Submitted: auto-generated Date: Thu, 09 Jul 2026 16:10:06 +0000 Message-Id: <6a4fc7de.37ac3.50297c50@gitrepo.freebsd.org> The branch stable/15 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f8e499fb0fc80f1e74a6a5b474beff9250c2fe43 commit f8e499fb0fc80f1e74a6a5b474beff9250c2fe43 Author: Ed Maste AuthorDate: 2026-06-05 21:00:07 +0000 Commit: Ed Maste CommitDate: 2026-07-09 16:09:36 +0000 ipfw nat: Add assertion that mbuf is not a chain Discarding m_free's return value will result in an mbuf leak if the mbuf was in a chain. In general we should use m_freem if the mbuf may be in a chain, or assert that the return was NULL. There will not be a chain here due to m_megapullup, so add an assert. Reviewed by: ae Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57479 (cherry picked from commit b16c731b0191d6c47de46a3c6057b0c5ec0dd420) --- sys/netpfil/ipfw/ip_fw_nat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index 34e60edfc4a5..05100d581424 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -291,7 +291,7 @@ free_nat_instance(struct cfg_nat *ptr) static int ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m) { - struct mbuf *mcl; + struct mbuf *mcl, *mfree __diagused; struct ip *ip; /* XXX - libalias duct tape */ int ldt, retval, found; @@ -396,7 +396,8 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m) (retval == PKT_ALIAS_IGNORED && (t->mode & PKT_ALIAS_DENY_INCOMING) != 0)))) { /* XXX - should i add some logging? */ - m_free(mcl); + mfree = m_free(mcl); + MPASS(mfree == NULL); args->m = NULL; return (IP_FW_DENY); }