From nobody Mon Aug 17 12:10:19 2026 X-Original-To: dev-commits-src-branches@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 4hNs975Kp2z6pC7q for ; Mon, 17 Aug 2026 12:10:19 +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 4hNs9749K9z3Dvc for ; Mon, 17 Aug 2026 12:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786968619; 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=WVpRIlnD0zKRgBNOW10nKMChB5/5htYfvDcpmrA+Tus=; b=e49SgcLN/7UpvFpos/oFML4ghnhIoTks6zW1CrqKEHvcri8ahE6APtP64A7QP9cOIAw8Tq L6OgJkbcyKL2s+M4x8iHEVn5qozlqGylyk92wkmxk6/Szl0eGUQnzNLMl1hc3ObxPwx6OY jlU3FjjUyZgBCpja4z+rr8QIJlvFyzmVCsx7Iup99aSE4dJmHDEmN5FaD9fTH1gA87JLMB FeYaElrvllk2pSeHsRd4+YI2c4cODdcItK6L0dx1ig66r3Co0ltd7fmfDPGPgTdyQuCIc3 X9hCWmylmNmj21MS3n1G1eXmRwAuItFb3tfq4hryxfSLDhrRYwkEZvX3+EXgWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786968619; a=rsa-sha256; cv=none; b=j1WYD13izxuS7w21dqm1Q9QSFWErJeQJVNipIeRYUFCDETox4F/83xq0KA9fdZQBxFKX8K a4LsY+5XiYmpmifLQS91GhqYufDL31e5T63B1nyH4ZpK8HuRfWCbe8k5MkWRci8brO1tzD Ee/hH/Dw+M3gfpx5pak9D7nGje+MKFCGdWeszL+QNjV6lZYm8j+NS9ObkHbGUVFd6oTZkK GZNaDVi3lLC0ZMDodZCcgamDRdY1zpQflH/P+W7zI4Mfk3p2mogWocDH73gi0jciJbcj1l lqZGQBc2F+JikYt4o4ffBspsBBesavRJamdqd8VQhBoD/i86rQw84IwYCpHpiQ== 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=1786968619; 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=WVpRIlnD0zKRgBNOW10nKMChB5/5htYfvDcpmrA+Tus=; b=eM0RpAgrE9RyVVO9CpmyWWfgCny8OIsD9C6vqzzK/RiQXBVhuWN8UN0lG82O6w8BsliT1L ph0bSwnZg+K4/F/TWWwUBTGlaDxjA/+MtLoYxfnntNZOCMWhCc4FIY859YpskDnf0GjtdQ nsj2QAtViJ7BYpoxsMmawJ7HL8g47/5g2VEm4wTuVVZa8T+ocARJovjAaiQM1eWZIFyoqU tK/31P9qQ3VZZ9ebOLhKnWV6an3PHXu3w4a6a1+QL7gkU7HGNxbQDmjiJTCxcoagvZh4Mq IcQeIkasB7MJXit/P8w1kaUWW5hGWYxqyxyCvApU820d8dNpKM0g7qlE2JMC5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hNs973CTcz1CYs for ; Mon, 17 Aug 2026 12:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b4d0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 17 Aug 2026 12:10:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 730e18a4607c - stable/15 - rawip: Fix handling of checksums in rip6_input() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 730e18a4607cdec7ace37808455acda0585f31fa Auto-Submitted: auto-generated Date: Mon, 17 Aug 2026 12:10:19 +0000 Message-Id: <6a82fa2b.3b4d0.59b24c48@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=730e18a4607cdec7ace37808455acda0585f31fa commit 730e18a4607cdec7ace37808455acda0585f31fa Author: Mark Johnston AuthorDate: 2026-08-04 13:35:35 +0000 Commit: Mark Johnston CommitDate: 2026-08-17 12:07:41 +0000 rawip: Fix handling of checksums in rip6_input() A v6 raw socket may ask the kernel to validate the checksum of an inbound packet. If it does, and the validation fails, we discard the packet, but this isn't really right: other raw sockets may wish to receive a copy of the packet anyway. Rework checksum handling to address this problem, and use a flag to avoid computing the checksum more than once for a given packet. Fixes: de2d47842e880281 ("SMR protection for inpcbs") Reviewed by: pouria, glebius Reported by: Yunzhi Ke MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58559 (cherry picked from commit 196874ce2e97e3e6425493b1d501e716b356bc36) --- sys/netinet6/raw_ip6.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index ea12626893a4..8e080f43cbdd 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -191,7 +191,8 @@ rip6_input(struct mbuf **mp, int *offp, int proto) struct rip6_inp_match_ctx ctx = { .ip6 = ip6, .proto = proto }; struct inpcb_iterator inpi = INP_ITERATOR(&V_ripcbinfo, INPLOOKUP_RLOCKPCB, rip6_inp_match, &ctx); - int delivered = 0, fib; + int cksum, delivered = 0, fib; + bool cksum_computed = false; M_ASSERTPKTHDR(m); NET_EPOCH_ASSERT(); @@ -231,19 +232,22 @@ rip6_input(struct mbuf **mp, int *offp, int proto) */ continue; if (inp->in6p_cksum != -1) { - RIP6STAT_INC(rip6s_isum); - if (m->m_pkthdr.len - (*offp + inp->in6p_cksum) < 2 || - in6_cksum(m, proto, *offp, - m->m_pkthdr.len - *offp)) { - RIP6STAT_INC(rip6s_badsum); + if (m->m_pkthdr.len - (*offp + inp->in6p_cksum) < 2) + continue; + if (!cksum_computed) { + cksum = in6_cksum(m, proto, *offp, + m->m_pkthdr.len - *offp); + cksum_computed = true; + RIP6STAT_INC(rip6s_isum); + if (cksum != 0) + RIP6STAT_INC(rip6s_badsum); + } + if (cksum != 0) { /* - * Drop the received message, don't send an - * ICMP6 message. Set proto to IPPROTO_NONE - * to achieve that. + * Drop the packet, don't send an ICMP6 message. */ - INP_RUNLOCK(inp); proto = IPPROTO_NONE; - break; + continue; } } /*