🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26772

Re: [PATCH] netfilter: flowtable: update skb csum after pppoe header push

#26772
From: lvjunyu
Date: Thu, 03 Dec 2026 13:51
40 lines
10351 bytes
The issue was found by manual code inspection and has not been
triggered at runtime yet. Details for both questions:

How the issue was discovered:

While reviewing the flowtable encapsulation paths in
nf_flow_table_ip.c I compared nf_flow_pppoe_push() against its
sibling helpers. Every sibling path keeps skb->csum in sync when
it moves skb->data:

  - nf_flow_vlan_push() calls skb_postpush_rcsum() after pushing
    the vlan header
  - the pop path (nf_flow_encap_pop()) uses skb_pull_rcsum() for
    both vlan and pppoe

nf_flow_pppoe_push() pushes the 8-byte PPPoE session header
(__skb_push(PPPOE_SES_HLEN)) but never folds those bytes into
skb->csum, so for CHECKSUM_COMPLETE skbs the checksum stops
covering the bytes from skb->data onwards. Checking the history
(cgit, commit 18d27bed0880) shows the call was missing on the day
the helper was introduced, so this is a defect since the first
version, not a regression of a recent refactor.

Whether the issue was actually triggered:

Not triggered at runtime so far; the defect was established by
source inspection, so the runtime evidence is an impact analysis
rather than a trace:

with a pppoe-offloaded flow and a CHECKSUM_COMPLETE skb, every
later incremental checksum update on top of skb->csum starts from
a stale base (the pushed 8 header bytes are missing from it), so
downstream consumers can compute a wrong final checksum and drop
valid packets. The fix mirrors the vlan push path and only
touches the pppoe push path, so the change is limited to keeping
the existing invariant on one more path.

The patch is build-verified against mainline tip (nf_flow_table_ip.o
compiled clean) and checkpatch-clean.
Technical Details
Message-ID: <20261203135145.191790-1-lvjunyu@cmss.chinamobile.com>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.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-377106-linux-kernel-netdev=dewy.ru
References: <20261203094901.164422-1-lvjunyu@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.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-377106-linux-kernel-netdev=dewy.ru
From: lvjunyu@cmss.chinamobile.com (lvjunyu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] netfilter: flowtable: update skb csum after pppoe header push
Date: Thu,  3 Dec 2026 21:51:45 +0800
Organization: Usenet Network
Message-ID: <20261203135145.191790-1-lvjunyu@cmss.chinamobile.com>
References: <20261203094901.164422-1-lvjunyu@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2690777"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:r8+dFqnpws9jSnozQ+95hP1nsuo= sha256:hLMb2nqJWu0b1wQJBEzuiMIIKoYxXXZCvVdffp1/7A8=
	sha1:qGwkNxDpt6Z6fU+i3xc8pDb0v3c= sha256:GDz6YC6+YR6Tz79GodGpqkvf1OcMAfuE+AHtnc+YVcw=
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 4311D117B27; Fri,  4 Dec 2026 09:16:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.194
X-Spam-Status: No, score=-2.194 tagged_above=-9999 required=6.31
	tests=[DATE_IN_PAST_12_24=0.804, DCC_REPUT_70_89=0.1,
	DKIM_INVALID=0.1, DKIM_SIGNED=0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.001, 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=fail (1024-bit key)
	reason="fail (body has been altered)" header.d=cmss.chinamobile.com
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 IAmdu_ZV_cLK;
	Fri,  4 Dec 2026 09:16:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-377106-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 840CE117B01; Fri,  4 Dec 2026 09:16:00 +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 2A25821E0E; Fri,  4 Dec 2026 06:15:58 +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=1796364955;
	b=PPi7upocuHdtYU4VmEpxY+pRh9hYKxd6eLU3BhI6VVpFfXRF5hzV23bzHuEFZ2A7zoJA
	 0r/QrwZMz8EaP+mjgV9jeZk5xDVwBRy1g9msS/6udPBfzHHD2n//GSTPULY6433z1f7r8
	 kxATwOit2meYRF/k9TnK7qduoKGsr2ANULFkaRJGrFNuC3K5R00pTHIPF1ReEzY/twZ2z
	 bi12Z0pdEGZIUy8SBk59HT6dCKDdCaAFWsmcZRR8w2jhhCVvyKZkoYG6c0VyRiQ9pu4W3
	 4zg3hPhI0Kh0xNnYEeLcOcDHVlt2kIMRFl7Ex4NkqkYx13OuyzhSnNAm+ydOjIs/R/g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796364955;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo:
	 X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:
	 Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=0Kty5aNeH4sMLe+k8qdIJrn9e+qom94BIRWCuiS9OKk=;
	b=3WFjkPpApRKSQl8oiMD0q9PktwB9ux7Onb3AWcUmqz6BlX9FJlAnF7Nan9DabZbRXddF
	 XwIEmwxRqaCeA+q1nzYRGFkr+5Fv9VafSMmQbPqmvMPhfb/HIYhK1+HEPVW9VmTC5Q7s0
	 NHS2YnISB7sjdaTPn9oMlu3cIM6Vn3HeDOLFERh8ZFbPhbAfFK++P/08vMHnYqYtcK9bd
	 05J0WfZ9mrwVxJB7F6ozt3zGdOmVjacbZ1ayEeRn6chQZizZkh4OtRmF5zYDlzxyPmsfn
	 pE1T3BpRyUyt7WHfDc8LJ9AyKs0rjkwUsKZ4y32ZkZez7J+8Czy0MPveeLiNo8opfQQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=nyG31XaO;
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	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 6ECFB606A334;
	Fri,  4 Dec 2026 06:15:55 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=nyG31XaO
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.151
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796364954;
	b=dP2RFe5Zki4r+WYxdM4qK05D4gV0qP//4zr0ix6/e9NUMQqta9xH5JiZIhKBca+pzr4i
	 s7Dsk5sU8un7wghezsNsOysapuMJQFzXnXswCGaESB8p8AMq18hJAQRsGeete3mk3NkaH
	 BuguX0PRdcK5UGmO0k97Z+Uvey1t8m5zbjoDQmfhX8x1GurytCQz8ellXROYbWkmm/hgq
	 Mj5vJ636PSBk2rUrq/W+Lv54GXRBPVV1MY6EoyVFP7h1gcuDyLtxMnWEcQJqNrNaL+M1m
	 Z55QiRAL7YFCQgdmw7gixqGgIOziyC6zVeQU55DDWuFEt8sivuqZ4bJenFSk8Wt0tkw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796364954;
	h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:
	 X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From:
	 To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=0Kty5aNeH4sMLe+k8qdIJrn9e+qom94BIRWCuiS9OKk=;
	b=fxt2ipO+K4GWpxrjjXXPDH4O77Sskv7jXCqdO9PnsMBclqQIjBu2ZPkZum1ZRZSGTNds
	 I8xNclHXGLPdMrYtM950CgXV08JntPg4HfZb7EWtBA5Iw37TM8AO0ThKukupxy3hx1DB2
	 mCCiCXLnDi4KY2YKpmA8GtZR7ej4+R8i3bfAVPfQ0LfBxcBhmdBqx0ZVC28GTrRSuzftk
	 oTjU1chZZJSOj4vAff+ZCnldkNowmzs1T96MmUDFS7OyGbrfBLTSLdA/R84qi73dL8D3X
	 DyFjRDKL3WKP3zqsXXhdxMP/TalhliquqQycjN8t4zmIy63fC3uY8lIBFLiZckVWTPw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=cmss.chinamobile.com;
	spf=pass smtp.mailfrom=cmss.chinamobile.com;
	dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=nyG31XaO;
	arc=none smtp.remote-ip=111.22.67.151
X-Received: from cmccmta8.chinamobile.com (cmccmta8.chinamobile.com [111.22.67.151])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C8642606A330;
	Fri,  4 Dec 2026 06:15:51 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C8642606A330
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=cmss.chinamobile.com; s=default; l=0;
	h=from:subject:message-id:to:cc:mime-version;
	bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
	b=nyG31XaOWOlDlIyxg8lebqnsVA1QAlsTYRcAodtEc9GgmdR9Gb2ag8ajCJNmSbJdQKYix3ubqlxA1
	 R0vP6VJ15QS9wHjnEJmgiRBwM2mZf+B9+z3tbGZnwbeL1mL/HjWkIjdAvzgE5l1MyRBPB4X/ehwF/f
	 l71EGyS+suZd0XAQ=
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87])
	by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee26b125a9507c-ddf83;
	Fri, 04 Dec 2026 14:15:49 +0800 (CST)
X-RM-TRANSID: 2ee26b125a9507c-ddf83
X-RM-TagInfo: emlType=0                                       
X-RM-SPAM-FLAG: 00000000
X-Received: from localhost.localdomain (unknown[223.108.79.102])
	by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee46b125a7b4aa-8c651;
	Fri, 04 Dec 2026 14:15:49 +0800 (CST)
X-RM-TRANSID: 2ee46b125a7b4aa-8c651
X-Cc: pablo@netfilter.org,
	fw@strlen.de,
	phil@nwl.cc,
	netfilter-devel@vger.kernel.org,
	netdev@vger.kernel.org,
	coreteam@netfilter.org,
	lvjunyu@cmss.chinamobile.com
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <20261203094901.164422-1-lvjunyu@cmss.chinamobile.com>
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