From nobody Sun Aug 30 18:04:28 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 4hY0Pm6HLFz6rDnr for ; Sun, 30 Aug 2026 18:04:28 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hY0Pm4SlVz3mW6 for ; Sun, 30 Aug 2026 18:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788113068; 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=rDM74WLpxOoNlx/b/UiFBDkB2ILouKBE83BA/E7I21g=; b=bfuTqezP735zGOkv4xTw9RPfdZhk2bKNNxdRYRXh6bXM/p9LP/uWGe/mWtw8FqJY8H/pwk /NfeHCJfEgLhyIh7mbaaizpYzH4D9baPtPiqjestmRNrlNxRV8K+FsVSPPQFiBgFJXLCZX NlmKFDYnndw34UpcXBO5ddLFhe+PVENL9dZn6CPXgCwSoEwfrABUhdAys6K3NbTjXdXQfW tfos3JiSJ7etHEpMD2gX5OFZGZnYYHac5ungQBH6LVR3mNCvSsYv5ARb97fnyu89jRTBQo j937Tjeb+MG+PoNGuHCBrTohK5xgy1ZazP1pfTlMDNtkU/1qtobqLQB4aAzlIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788113068; a=rsa-sha256; cv=none; b=dD2iABoOUKXdayjzQqXH9aAObd+jpbTmuHovnfKmnsYWK+t9um1B6WYO1GQBhzx2WZjH2J b2FEIa8Pw+GrU9yYqk+ODIh4Qj3c2IqauIy2kH2RSVdmVsdBeK/dhY1wb0QOfh8tl2+onS wYYd508Ia9otfn5Hfe7CA7C4Vpz+nurGSJT/La/GR7EM9qGQvRU0jLE7vehSkCgt4GjpYA KPph5uj2wC6lxl4q+miy2jeW4PpQtvnktxL+7nJ/oQaKjhQZBniD8OCGTdN5wrikmPwsy6 xIrU39Aw25jLq5ldDBiOGRfGB2wk5HH/X4JwLi2onH0aUdYLiPCA+Mfi0hJ65Q== 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=1788113068; 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=rDM74WLpxOoNlx/b/UiFBDkB2ILouKBE83BA/E7I21g=; b=CRbQGoTMBysVjcJ5sd8edeuhK6Ip69kgQOg95DEE8/3QyWzqI7paw0RXQGX6Vib7eJEesB Y6S+hwBBR/0sSeRQLqcRR+lnSNi2T+e1UEBX3lJxNvROCAkuI1ENzCtbuCosG/XIMKiLuS BVzam4/rLnIKMqLYaEu1WE/7cDcdtBvjNQnR/+8goos1pD+SPy2EhKmNfRzKSzKGG/plEi av59uLNt7Ry0ElTOh6/hXGGPjsVws4iUJxgTW+BTujdZkRu9FBR/3oyWKYeGAxEnm3fVD6 OmfQL7NlkK24YZ0vNexXHXxadJzgtd3cdZ3FBWj+g6G/Jv1WLVARya1lUC0R3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hY0Pm2DQZzcCK for ; Sun, 30 Aug 2026 18:04:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2587f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 30 Aug 2026 18:04:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Aaron Espinoza From: Pouria Mousavizadeh Tehrani Subject: git: c006c8dac0e5 - main - if_bridge: Fix NULL softc dereference in bridge_input() 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: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c006c8dac0e5de354c48e3b5fc2bce4e0e6f5152 Auto-Submitted: auto-generated Date: Sun, 30 Aug 2026 18:04:28 +0000 Message-Id: <6a9470ac.2587f.7e68db31@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=c006c8dac0e5de354c48e3b5fc2bce4e0e6f5152 commit c006c8dac0e5de354c48e3b5fc2bce4e0e6f5152 Author: Aaron Espinoza AuthorDate: 2026-08-29 03:16:35 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-08-30 18:04:18 +0000 if_bridge: Fix NULL softc dereference in bridge_input() In bridge_input, sc is initialized to NULL and doesn't get resolved until after the Ethernet header pullup. So the pullup's failure path ends up dereferencing the NULL sc when bumping up IFCOUNTER_IERRORS. The m_freem call right under it is redundant as the failure path in m_pullup already freed the chain. Drop both lines, matching what we have in bridge_output. ether_input_internal() discards frames shorter than ETHER_HDR_LEN before the bridge hook, so it is unlikely that it will fire. We still keep the guard as lagg(4) and ng_ether(4) may replace the mbuf before the bridge hook. Signed-off-by: Aaron Espinoza Reviewed by: pouria Pull Request: https://github.com/freebsd/freebsd-src/pull/2393 --- sys/net/if_bridge.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 792b2c952e7a..ef7101f13224 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -2857,11 +2857,8 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) /* We need the Ethernet header later, so make sure we have it now. */ if (m->m_len < ETHER_HDR_LEN) { m = m_pullup(m, ETHER_HDR_LEN); - if (m == NULL) { - if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); - m_freem(m); + if (m == NULL) return (NULL); - } } eh = mtod(m, struct ether_header *);