🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18987

Re: [PATCH net v2] net/sched: act_csum: bound the IPv6 jumbo payload length

#18987
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 06:22
144 lines
13886 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The v2 changelog says the TCP, ICMPv6 and UDP-Lite ul == 0
  paths were exposed only to "a bounded over-read of up to 63 bytes",…
- [Medium] The changelog understates who can trigger the bug.

--

net/sched: act_csum: bound the IPv6 jumbo payload length

This patch bounds the jumbo payload length parsed by
tcf_csum_ipv6_hopopts(). The length must exceed IPV6_MAXPLEN, the IPv6
payload_len must be zero, and the claimed length must fit within the skb.
This stops the ipl + ntkoff sum in tcf_csum_skb_nextlayer() from wrapping
and keeps csum_partial() from reading past the end of the skb.

Link: https://lore.kernel.org/r/20261112075159.3552470-1-piyus@iiitd.ac.in
Link: https://lore.kernel.org/r/20261112075445.3555341-1-piyus@iiitd.ac.in

> 16-bit length, since ul <= ipl - ihl compares against ~4.29e9, and
> csum_partial() reads that many bytes off the end of the skb.  (The plain
> UDP arm is not affected: it requires ul == ipl - ihl.)

[ ... ]

> So "action csum tcp" and "action csum icmp" setups were exposed to a
> bounded over-read of up to 63 bytes on kernels built without KASAN, while
> the 65535-byte read reported below is the UDP-Lite case specifically.

[Severity: Medium]
Is this impact statement complete? It covers only reads, but the same
wrapped-ipl path also seems to allow out-of-bounds header writes.

When ipl + ntkoff wraps, the only check that any transport header bytes
exist is the loop guard in tcf_csum_ipv6(). It covers one byte:

    } while (pskb_may_pull(skb, hl + 1 + ntkoff));

tcf_csum_skb_nextlayer() then lets the wrapped ipl through. Also,
skb_try_make_writable() does not check the length:

    if (!pskb_may_pull(skb, ipl + ntkoff) || (ipl < hl) ||
        skb_try_make_writable(skb, hl + ntkoff))

After that, the handlers store to header fields whose offsets were never
checked:

    tcf_csum_ipv6_tcp():   tcph->check = 0;          (bytes 16-17)
    tcf_csum_ipv6_icmp():  icmp6h->icmp6_cksum = 0;  (bytes 2-3)
    tcf_csum_ipv6_udp():   udph->check = 0;          (bytes 6-7)

In tcf_csum_ipv6_udp(), the udph->check store comes before the ul tests:

    ul = udp_get_len_short(udph);

    udph->check = 0;

    if (udplite) {
    ...
    } else {
        if (ul != ipl - ihl)
            goto ignore_obscure_skb;

So the plain UDP arm cannot do the large read. It still writes at an
unchecked offset, though, and udph->len is read from the same unchecked
header.

On the rawv6_send_hdrinc() path, the skb is allocated with
length + hlen + tlen + 15 bytes. With tlen = 0 and a length of the form
41 + 8k, the tailroom can be exactly 15 bytes. Two examples are 353 bytes
in the 704-byte small head and 673 bytes in kmalloc-1024. With a 1-byte
TCP header, tcph->check then lands on skb_shared_info at skb->end. KASAN
would not flag this because the store stays inside the allocation.

The code change closes all of these paths, since the new bound on *pl
keeps ipl + ntkoff within skb->len. v2 was a changelog-only respin meant
to describe the exposure. Could the changelog also mention these writes,
and qualify the statement that the plain UDP arm is not affected?

[ ... ]

> The packet is generated locally through a raw AF_INET6 socket with
> IPV6_HDRINCL and leaves an Ethernet device, so skb_network_offset() is
> non-zero and the sum above wraps.  Reaching it needs a clsact qdisc with
> a csum action carrying TCA_CSUM_UPDATE_FLAG_UDPLITE, which is
> CAP_NET_ADMIN in the network namespace - reachable by an unprivileged
> user through a user namespace.  The folded checksum of the out-of-bounds
> bytes is written into the packet and transmitted.

[ ... ]

> Conditions it needs: a clsact qdisc with a csum action carrying
> TCA_CSUM_UPDATE_FLAG_UDPLITE, on an Ethernet-type device, with the packet
> locally generated so that skb_network_offset() is 14 and the sum in
> tcf_csum_skb_nextlayer() can wrap.  CAP_NET_ADMIN in the network namespace,
> which CONFIG_USER_NS makes reachable by an unprivileged user.

[Severity: Medium]
Can a wider set of senders trigger this than described here?
CAP_NET_ADMIN is needed to install the csum action, but not to send the
packet that reaches it.

A bridged IPv6 frame from another host also arrives at tc egress with
skb_network_offset() equal to 14:

__netif_receive_skb_core()
    skb_reset_network_header(skb);
  -> bridge rx_handler -> forward
br_dev_queue_push_xmit()
    skb_push(skb, ETH_HLEN);
    dev_queue_xmit(skb);
  -> tc egress -> tcf_csum_act() -> tcf_csum_ipv6()
     -> tcf_csum_ipv6_hopopts()

These frames never pass through ipv6_rcv() or its jumbo option checks.
The only bridge-side check is br_validate_ipv6()->nf_ip6_check_hbh_len(),
and that only runs with br_netfilter.

act_mirred ingress-to-egress redirects also push the MAC header back, so
ntkoff is mac_len at the target device's egress.

Take a bridge, VM tap or container veth host where action csum is
installed on a port's egress. A remote, guest or container sender with no
privilege on the host could send a jumbo length of 0xFFFFFFCA. That would
trigger the UDP-Lite read, or the TCP/ICMP over-read and header writes,
and the folded checksum would be transmitted.

The new bound uses skb->len - skb_network_offset(skb), so the fix covers
these paths too. Since this affects stable and security triage, could the
changelog and the conditions note describe this broader exposure rather
than only locally generated packets?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116182108.2581258-2-piyus%40iiitd.ac.in
Technical Details
Message-ID: <179506934898.3136.2983483959880388164@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366767-linux-kernel-netdev=dewy.ru
References: <20261116182108.2581258-2-piyus@iiitd.ac.in>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366767-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] net/sched: act_csum: bound the IPv6 jumbo payload length
Date: Thu, 19 Nov 2026 06:22:28 +0000
Organization: Usenet Network
Message-ID: <179506934898.3136.2983483959880388164@kernel.org>
References: <20261116182108.2581258-2-piyus@iiitd.ac.in>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2806024"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:GF5pOFxZ13LjD3b27OgL9TY7uwE= sha256:RNkOeOprXRPu+UrK8l5FDESTLacuSPQfWh4BH3cGndQ=
	sha1:zWBBmMuXjUrhkyruLzFKU2RQ6EI= sha256:L/NEni7WnuKfzj/7doVJrubfRPJLstOQKIiLrIoVFWI=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id A58F711551B; Thu, 19 Nov 2026 09:23:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id sKyFR3OSIsll;
	Thu, 19 Nov 2026 09:23:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-366767-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 5F3191154B7; Thu, 19 Nov 2026 09:22:58 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 74E7616965B; Thu, 19 Nov 2026 06:22:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795069356;
	b=Vw5bkucHd6fdMgB5R+em5sRxeKsFt2u1oM+T5z1g1AuJ1wAfgSQV+QjM0tsbU8EdMay1
	 YljtrDUmt6DGrQ+HkGLmwTAQnyxxk880b890V7TTOrBeHPyiv7/UaMjK6vEleGbu/PbFl
	 Lu9rzG/yX1XuBVH3pPPnJx0xm2JUaE/ucBupsYZ+hCdMjWg4s4mB7nZqxMiTdgxqzOR1n
	 O65t83BHdsd55gOO+DripyScvdBu8pJZrYRd4AItlUmXM80MpBD6ITGtD/LA4PqC+SOS5
	 py8NjGObwppvsO3M80wYrffMMMcO2oa0LOqTHsDctZ9ARd5SaW9L1omo/0x5Qrx/VPw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795069356;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=mBBLFHn2+33Nh68ew1lXsaRwuuz7TPCR0eOaeXY0uQY=;
	b=RLK290XEF5yTRIwTTMjlpUKXz+Bb4DS3lT/ijIljNESLFagE4wEb5XWrusL/KRdSngTO
	 RKpkWO0e96xAiKJ3rAVS+jK4p2sSDGT1Cs8p3h8NBtAvNY5PleE2+kH76tCiygR7ASCEp
	 +m0cxytzNXbTgG/DISOinlS7ketjtZZyydj+fp43bGXm3pPbFEGpx0xWI0/FEPpUzufTG
	 iK2yfDfek2Oq38Hcde1hO8a3i13MIrxf/YryiZIATyAEAe/jFLwiGx3VmuTc5rxdufMIW
	 qm60Hl7fSDzKXc0G2VGmAmr0dz2k7s94Vu46LS+TwWHJ10Fw6ztMV6/tUnMUiCLg8Cw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=foLa6Lrz;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DC4F606A333;
	Thu, 19 Nov 2026 06:22:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=foLa6Lrz
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795069350;
	b=gbKiGUvSbuTDgV3tqLKPy0GvYzkScZ23J0qtOy/EXkPDS1xm/pbTH4+Qkhfh2fQslE67
	 OzykLwSb30EpQZY5/xg+CxWZMWnEZFhfvRVizPeD/WzPD359SMUXANKtmlKVcNfEiQ7EJ
	 kYXWwGsjO/wBD5AAM5nkrzMNZPfj1LXpH62AKMOyxVmY/WV3nMdyUCMY+eejIwLRVgumy
	 37fI84yei8v7G/sVSHFLOm8dByv7I/2hYNcUIL6W/bccG12cK2IAIEcCTl35JZ6MjtEYe
	 6NBe5x4CbR4hpSyTKB29LLq/mTD5emn3ud5ZAjjUhR+CYFWT0Zoh9Nb535Fxt227UTA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795069350;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=mBBLFHn2+33Nh68ew1lXsaRwuuz7TPCR0eOaeXY0uQY=;
	b=cxrx3QL9NU5VdpTKEFZzW4zuzmpelEJIFOAk6b96pfvB1x523A4I9PbLa0UfIBUK1/vd
	 nghf0z16R4xUyTeUTCcjIFubbZV6lXZqwMoehZP8GdKjyjDw9IIto3p/t/pOLZVczCepV
	 CNt+MpKPrp/EcgTdr6uD/d8eb6AE+etWHc3IkpfWYd+e3s1ohsw3nv7T2ptq8+8ly5IUF
	 MB8N+vDb4Jlw9l/0wxqS5d0LavVJb0ILG1FA3MnjJCP3OqRFCb58T9lEWbGzRXhnhA4TP
	 t0HUOgXOmvfvG0DkqwdlnrnZ2PBF1QaGGj80G4COnYUJVtDeqYNf2Zxn2PdXz6pcXFQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=foLa6Lrz;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C877606A326;
	Thu, 19 Nov 2026 06:22:30 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E9AF1F000C5;
	Thu, 19 Nov 2026 06:22:29 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795069350;
	bh=mBBLFHn2+33Nh68ew1lXsaRwuuz7TPCR0eOaeXY0uQY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=foLa6LrzsH1eeQA4Tfrvomi+9TBkSodt9806M+hQDPTqYkjbDkZ1k0JoSGBr69AQ2
	 C0JH33sW0z+JpQ82ykBeCBt6l4Y1aBrOb4c3xs9ypBhgACUqNzJ4DBsTwmLEUecanA
	 QGCTrdthpNNYUJ9sjJeodSs8vEyLVdu5j0Y0Cv2Gdu89J3ygRf/0FIRBZKMKFP7knx
	 9wPb9rdDap49CHFO0EG5ngfDZW6LqWSNiLdzfKreaGFMCBCRuKX81boeY/TTHexEvg
	 aewXaVl9zpJLSBbKKekNCWdypa6b5t8leHfgx7wDjyVL1tMeJsGCxX6c9dgOrpyfVS
	 I6FBCU89ADnbA==
X-Cc: jhs@mojatatu.com, jiri@resnulli.us, netdev@vger.kernel.org,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 horms@kernel.org, linux-kernel@vger.kernel.org, kapil@presceralabs.ai
X-In-Reply-To: <20261116182108.2581258-2-piyus@iiitd.ac.in>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list