From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380969; b=rnKctj6ZfvFjHmfEe49rxzZG/Wm9e5eoxh4NjH6idJ5n4ji27C9HRpaEbuR2scAJdEpI S3lvpFTlRzjLliful519BTPNZjR9oF3qPPeWy9KNMyaOtHif/rgJe5eCk84h1cAwOZCaW Pcprvp1Umxs7StSg7GdioFXb4ozWFk2TFqJAHMWHNYkbS1DY7IlQhplHXY1cKj7vIhakk afpPyHzEeW1MyC6hTdrKPlS6cj953VQNg8cu0A6uEPbdKKpW6DiG79ICduK0O2qqkrBYi lShkIJ1jYW7shdtNPZlGGKo6LJFFhBeuqm+iVNMrzWo0kRawqyLNRAvLNQ3azz+FaiQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380969; 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=FzUpg2FpsMzB5YoE3IerFlLh0tePF5JW9pKaijWG3AI=; b=oWN4aTnnYa2WwpBzN2L0nmJODcb+8ZWHc3jgQov65zptS95PM7Qdb+4Ep70rwmGfs169 mOYUGwtlYm4OW29sszMlW14fbbVLh9D1AeCArQvPVjkk1l4NC5MLVtw6Pza9lnyZc5Il6 cyFXZCWzP+wxnb3TcCWH0iwsuAnCDYT9NI5uKOdZ4fqSmMkjgZaNXB/NqGQyVTR1I313M TazuRPeAPjEUg4vpCZkTrWE/PldNblBpCC0Sin5dNh5njVgVjtmos04Lh8MpU0v8Wo41y 20UP/IR/NkRet8+f1eXvqdO6qdgXRVKMZimTG4gMIl2L6CfiFiNASJ6a253a9goCztg== 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=jrYbSxCl; arc=none smtp.remote-ip=100.103.45.18 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 62474606A32D; Fri, 4 Dec 2026 10:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jrYbSxCl Received: by smtp.kernel.org (Postfix) with ESMTPSA id B76BA1F000C2; Fri, 4 Dec 2026 10:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796380969; bh=FzUpg2FpsMzB5YoE3IerFlLh0tePF5JW9pKaijWG3AI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=jrYbSxClD3Pwn+1F3dMZ0/vrcIR/wMK88QPoYccTNa8uEySZmcTR0TMsbfmVgLgxF XMLJySfUd+Uv+ohSer3NT85cNavpPCtSVT6FZ33yE3fVmaDZo1Ee11+ir6uK6T2DCH xnvQpHWxXAnxwnUQjW0gZFFtmXXAL3qA+deevwefkGAhqSafziaME8iHSJ0gm1LBty UIrFqXNLHo7kVJypYyiZJuM+zEsfxO2EORTYEzlt00l4Kio/o/1hjpiQNIRqR8Jgnk HvK8sW/Ce2tCdRV5GM+EJpjJGK4465+lI9LUu8j2bkORnp8pLGJsMwLkDP/91XwMDt m+l4DY8GdFZAw== Subject: Re: [PATCH] netfilter: flowtable: update skb csum after pppoe header push From: netdev-bot+sashiko@kernel.org To: lvjunyu@cmss.chinamobile.com Cc: pablo@netfilter.org, fw@strlen.de, phil@nwl.cc, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, coreteam@netfilter.org, kuba@kernel.org Date: Fri, 04 Dec 2026 10:42:48 +0000 Message-ID: <179638096829.3146.10679863756672292574@kernel.org> In-Reply-To: <20261203094901.164422-1-lvjunyu@cmss.chinamobile.com> References: <20261203094901.164422-1-lvjunyu@cmss.chinamobile.com> X-sashiko-severity: High Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 1 · Medium: 0 · 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). - [High] The fix does not deliver what its commit message promises. -- netfilter: flowtable: update skb csum after pppoe header push This patch adds a skb_postpush_rcsum() call to nf_flow_pppoe_push(). The goal is for skb->csum on CHECKSUM_COMPLETE skbs to cover the newly pushed 8 byte PPPoE session header. It follows what the vlan push path already does. > diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c > index 19cafae748abe..a0b541b811b40 100644 > --- a/net/netfilter/nf_flow_table_ip.c > +++ b/net/netfilter/nf_flow_table_ip.c > @@ -585,6 +585,8 @@ static int nf_flow_pppoe_push(struct sk_buff *skb, u16 id, > ph->proto = proto; > skb->protocol = htons(ETH_P_PPP_SES); > > + skb_postpush_rcsum(skb, skb->data, PPPOE_SES_HLEN); > + [Severity: High] Does this actually leave skb->csum covering everything from skb->data onwards by the time the skb reaches later consumers? nf_flow_queue_xmit() calls nf_flow_encap_push() and then __nf_flow_queue_xmit(). That pushes the Ethernet header right after the PPPoE header, with no rcsum update: net/netfilter/nf_flow_table_ip.c:__nf_flow_queue_xmit() { ... skb->dev = dev; dev_hard_header(skb, dev, ntohs(skb->protocol), xmit->dest, xmit->source, skb->len); dev_queue_xmit(skb); } eth_header() does a plain skb_push(skb, ETH_HLEN). After it runs, skb->data points at the Ethernet header. skb->csum still covers only PPPoE plus L3 onward. The checksum is still stale, just off by 14 bytes instead of 22. The consumers that keep CHECKSUM_COMPLETE across L2 expect skb->csum to cover the MAC header. For example, with a veth egress device, __dev_forward_skb2() in net/core/dev.c does: reason = eth_type_trans_careful(skb, dev); ... skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); This subtracts Ethernet bytes that were never added. The tc mirred egress to ingress redirect in tcf_mirred_to_dev() does the same thing with skb_pull_rcsum(skb_to_send, mac_len). Will these still compute a wrong checksum after this patch? There is also an earlier problem on IPv6 flows. nf_flow_offload_ipv6_forward() changes L3 bytes without updating skb->csum: ip6h->hop_limit--; So for IPv6, skb->csum is already stale before nf_flow_pppoe_push() runs, and folding in the pushed header cannot make it correct again. The core forwarding paths handle this by downgrading CHECKSUM_COMPLETE with skb_forward_csum(). That is done in ip_forward(), in ip6_forward() before the hop_limit decrement, and in the bridge forward path. nf_flow_table_ip.c never calls skb_forward_csum() and never sets ip_summed. Flowtable hooks are only registered at NF_NETDEV_INGRESS, so NIC-provided CHECKSUM_COMPLETE skbs from ordinary forwarded traffic reach this path. nf_flow_vlan_push(), cited in the commit message as the precedent, has the same limitation. Would calling skb_forward_csum() in the flowtable forward paths, as the core stack does, be a better fix? That would make the per-header rcsum calls unnecessary. The other option is to also fold the L2 header pushed by dev_hard_header() and every L3 change, such as the IPv6 hop_limit decrement, into skb->csum. > return 0; > } -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203094901.164422-1-lvjunyu%40cmss.chinamobile.com