From nobody Mon Feb 28 15:39:09 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 8A3BC19EB046; Mon, 28 Feb 2022 15:39:10 +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 4K6l0t2YClz4s2p; Mon, 28 Feb 2022 15:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646062750; 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=FVTAFPqJCTPMpnVstyQeXOXJbef7SoL0Mi5yU1LYing=; b=w7lAFNgQeITGRnqoAVS4tjSGmUi/IGZTVQnhoTWhNA+/dKKEhTHCc1lX89FNUatqdBk4QY Nni1Dt5btX0SedzE212+j0C1cfvR+RJQHQ6DPNF0d/IK8QiwyQA8tTiqySNfXD/mrpDuO/ 3pdRSfgXaWBr3QPTuRjoLt2D7votslbJI2Qyhsr13CfRQ/zOlBThZ25InGNGgIhICi4czz kfiXo3wRijDcZ0AcmFMC/bhoeAfFh2XqBgsdOS9zVyZFhKNAES3/zBu0SygNuVQKBDHIiM gdc1Zh8wmkc1Ft8weJ9ImOdzlcxREMjKpP4I4CG2jujl8bokdPMFVQXv33Ng0Q== 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 179CF1DFB9; Mon, 28 Feb 2022 15:39:10 +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 21SFd9u4085445; Mon, 28 Feb 2022 15:39:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21SFd9TE085444; Mon, 28 Feb 2022 15:39:09 GMT (envelope-from git) Date: Mon, 28 Feb 2022 15:39:09 GMT Message-Id: <202202281539.21SFd9TE085444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 226bb05ebcb6 - stable/13 - bridge: Don't share broadcast packets 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 226bb05ebcb6860313ec826c47542af2463b18ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646062750; 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=FVTAFPqJCTPMpnVstyQeXOXJbef7SoL0Mi5yU1LYing=; b=RJryx4g60jwLeL1WwWibDYAQr5exdukY0NHTbSVrtur3rcMkp9mAQWeGxsNvTFHCkRzYLm nd07OSSVYmmS7OyJs9bnJkqQUwhfl0uc4tI1+XWlgVZy1T1cEyyaA8t6P7f5yHZPD/JGvN //K03m3ZoUtJRNLp+aPL/2xLioXxBu9RVYgLGuIOramx3O2Z9K7ltAwBHGHN90WXqmpw98 hQC01U8F+PRHZYWN5Il1Tmyjtwixi9Qf6/YjUpM7tT5RdOVZeTC7QgpOwB2LYi0rrIsC+F yP+MIk31sFfzswg61d/Yzwf5/fvKq+NMUJMb0RFlPagIHHIE7BMlfevNT4s4vw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646062750; a=rsa-sha256; cv=none; b=utFNCHURWybdpq93ae7egN1das9oRkguMxJlUO1YuHtcdv0gvywGm2kErdNP7Ekbvt4Sjf fs/EGUGtzIe6LKgotLBO5w/behn69kiPqWBabVCzIkxBKer8PInVoKNWPcdP+9y9luXug3 Y+1MpvFoQeo2W/jiAQl+6HOEgB5APq0IXfO7SNqkQm6mXt2MZJloy/iLQO3b1vXjMGxSYm FvQd3bXiQDrI7TuTXjTR6wXYN8pJp7mN4EJ/uOWzWwMohdt7J2bV8DQEaemKhp1iRtvAAI KpSa1ZPvncgBQFSTVwj2/rPOJGc3yNpGXYZuDhg0p1Ly9AvAwwGuW61vprKzWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=226bb05ebcb6860313ec826c47542af2463b18ea commit 226bb05ebcb6860313ec826c47542af2463b18ea Author: Kristof Provost AuthorDate: 2022-02-19 15:34:31 +0000 Commit: Kristof Provost CommitDate: 2022-02-28 15:38:05 +0000 bridge: Don't share broadcast packets if_bridge duplicates broadcast packets with m_copypacket(), which creates shared packets. In certain circumstances these packets can be processed by udp_usrreq.c:udp_input() first, which modifies the mbuf as part of the checksum verification. That may lead to incorrect packets being transmitted. Use m_dup() to create independent mbufs instead. Reported by: Richard Russo Reviewed by: donner, afedorov MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D34319 (cherry picked from commit 36637dd19dba79088e53c6f2aa026415eae9f8f0) --- sys/net/if_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 926e7f9a1d19..02ccceed70a5 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -2164,7 +2164,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, used = 1; mc = m; } else { - mc = m_copypacket(m, M_NOWAIT); + mc = m_dup(m, M_NOWAIT); if (mc == NULL) { if_inc_counter(bifp, IFCOUNTER_OERRORS, 1); continue; @@ -2725,7 +2725,7 @@ bridge_span(struct bridge_softc *sc, struct mbuf *m) if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) continue; - mc = m_copypacket(m, M_NOWAIT); + mc = m_dup(m, M_NOWAIT); if (mc == NULL) { if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); continue;