🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8268

Re: [PATCH v2 net] ppp: linearize and segment bridged packets when required

#8268
From: Simon Horman
Date: Wed, 28 Oct 2026 14:44
58 lines
10898 bytes
On Mon, Oct 26, 2026 at 04:59:27PM +0100, Eric Dumazet wrote:
> PPP channel bridging hands packets received on one channel directly to
> the start_xmit() of another. Packets received by PPPoE can be
> non-linear, GSO since commit 55a5d8fca836 ("net: pppoe: implement
> GRO/GSO support"), or CHECKSUM_PARTIAL when injected with a
> virtio_net_hdr. The regular transmit path never sees such packets, and
> only PPPoE, which uses dev_queue_xmit(), handles them:
> 
> - PPP Async reads the whole packet through skb->data, transmitting
>   unrelated memory for non-linear packets.
> - PPP Async and Sync send GSO packets as single frames of up to 64KB,
>   and CHECKSUM_PARTIAL packets with a bad L4 checksum.
> - PPTP and L2TP cannot segment a TCP GSO packet once their GRE or UDP
>   header is pushed, and do not finish pending checksums.
> 
> Add a xmit_offload flag to struct ppp_channel, set for PPPoE. For other
> channels, segment GSO packets in software, using the PPP protocol field
> as the L2 header, finish CHECKSUM_PARTIAL checksums (including SCTP
> CRC32c), and linearize packets for channels without direct_xmit, as
> ppp_push() does. Packets are dropped if any step fails, or if the
> channel is busy, as before.
> 
> skb->dev is NULL at this point for PPPoE (cleared by __sk_receive_skb()),
> and tunnel and IPv6 UFO GSO handlers dereference it: only TCP, UDP L4
> and fraglist GSO packets without encapsulation are segmented, others
> are dropped.
> 
> Receive paths like L2TP pull headers without updating the checksum
> state, possibly leaving a CHECKSUM_PARTIAL state with csum_start before
> skb->data. Reset it to CHECKSUM_NONE, as skb_postpull_rcsum() does, so
> that skb_checksum_help() does not warn, and so that PPPoE does not
> offload a checksum at a wrong offset.
> 
> Tested in a VM by bridging PPPoE (on a TAP with IFF_NAPI_FRAGS, or on
> veth) to PPP Async on a PTY, PPPoL2TP and PPPoE: non-linear packets no
> longer leak garbage, GSO packets (including fraglist GRO) are sent as
> valid segments for IPv4 and IPv6, CHECKSUM_PARTIAL packets get a valid
> checksum, and PPPoE still receives GSO packets unchanged.
> 
> Fixes: 4cf476ced45d ("ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls")
> Fixes: 55a5d8fca836 ("net: pppoe: implement GRO/GSO support")
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/patchset/20260908072135.877364-1-qingfang.deng@linux.dev
> Co-developed-by: Qingfang Deng <qingfang.deng@linux.dev>
> Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>
> Cc: Felix Fietkau <nbd@nbd.name>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> v2: addressed Sashiko feedback
>  - Only segment TCP, UDP_L4 and fraglist GSO skbs without encapsulation,
>    skb->dev is NULL here.
>  - Reset stale CHECKSUM_PARTIAL state with csum_start before skb->data.
>  - Use skb_csum_hwoffload_help(skb, 0) to handle SCTP CRC32c.
> v1: https://lore.kernel.org/netdev/20261022111039.85112-1-edumazet@kernel.org/

Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID: <20261028144408.GX257209@horms.kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352892-linux-kernel-netdev=dewy.ru
References: <20261026155927.707655-1-edumazet@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352892-linux-kernel-netdev=dewy.ru
From: horms@kernel.org (Simon Horman)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 net] ppp: linearize and segment bridged packets when
 required
Date: Wed, 28 Oct 2026 14:44:08 +0000
Organization: Usenet Network
Message-ID: <20261028144408.GX257209@horms.kernel.org>
References: <20261026155927.707655-1-edumazet@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1792195"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:lbbOg9pF7J4lp4iVeqAPLdOb7Ew= sha256:o8EewXUdQ9AQGoAAfH55gura9WiH5Sw6M0T6robDFE4=
	sha1:6sTHUUGJmDGxoF54GHPmXpB7h54= sha256:i9pgGK9UeugIuRrebuNqG3Q/aMOiP4QoyrsWnkl7DzI=
Content-Disposition: inline
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 E002C125C37; Wed, 28 Oct 2026 17:51:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 hBY5EMdEeEW9;
	Wed, 28 Oct 2026 17:51:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-352892-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 24046125C33; Wed, 28 Oct 2026 17:51:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id E0FCF303C7; Wed, 28 Oct 2026 14:44:15 +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=1793198654;
	b=j3WEBv4SM04UgIW/4qO1DnHESH9emSCII3PhoZmgG/rfYFyom+WSbD3W+5njL28Lq63S
	 wOx1Yq958OPwAfj3jwPO4jWKBVdgwn55tVRCZ+ffNwCkKwlYIDZpGeTMTglWj7m3X/r9L
	 CgaGf60RaXPEn0W1IrWrODCx0MHIaCXFs8tMRv7bU1KPaNFFPsK5koPgWGkB5rifcqlRJ
	 hrxd/WT7t2h2hiFmOWzPK/brBtCuYlM867JjWYCOlsmtyeJaBL2CuMN8M78XX0zGdzYg1
	 m4A5hx3WCFEWfK/oYa5QFoRZV9hUzTJ7wnz6IBn8XTKbXiIXQQ4YEgkvtk0EVWxMOnQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793198654;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=1Q63vKXI7sX2+wwKEnsnoKjs6AlzUnkR62wP2YbR8PI=;
	b=TJQU4MZ+MGVI2Rmb+GaxNWBD1881Mwoj8nyjEVFMopHOHGy6HPhLF+judPCWAoFQepsW
	 MofZ9VuAwveJ2fP+eYFLntrklHFEqz+AN7Md3qFvztUZb18UNo09YkmPdxmFl2AjAooR/
	 ReQRoRSNqTdpagz1qUMPqvw57FEWWDDLTTHmtLmASgQfENP5V7gaZnUpQugkRDRhYF7wk
	 eiOsm1mAj3BtrqxMCBNZFILnQvtzWTv0fJGD8rt30AYZdU/6Sd2h5D5XERdZLMHF1JaIu
	 VBQir7F89wQ9AHtoI7GA07LqHYP5IIUjQ7sVC4nETRqr7fRjN98lb4E2zvNge2MaXDA==
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=NGb5aMol;
	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 31817606A31A;
	Wed, 28 Oct 2026 14:44:14 +0000 (UTC)
X-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=NGb5aMol
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=1793198653;
	b=VvNkHu0gBK1lBjAgC418Q6H6/kVqfKGKNMx6+g7vamN2HSoDc/YTA+JUc3pAX884E9Z3
	 yJz4M2bVzHDemXKaDjwO44YrHlqG+t9T0pOwe2nFJ2IrIpxv10sioCfQT8V82KyDPHcZR
	 +e1rWB7qeAET0yBlpuKaKj4Z0WbE2BjTE0lUFr1uRlnzfpuuadP7A0HyfeNku/hXNcobr
	 OlAO4UGFCqBonoUvJLT8+YWCOuZzw4z6RhYn07B0LIyyoySupuLJaNkY8JP3BezL8ae5z
	 INvWrXsVuFCYuNsm7tRYmYPkeGM0WQedCkUZ3wVL9Vm/+6w7A3jKtSRqQjMnTdpm8cQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793198653;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=1Q63vKXI7sX2+wwKEnsnoKjs6AlzUnkR62wP2YbR8PI=;
	b=3FQfvlYE0sKSoLCkQFx+SsW3VpsmJirUJvb4f7SKHrmPHmInxnAL7iDKSKvH0DeuwBl1
	 vax4SKono0hJ42Llm+jx+8Sh362fIoNd4w2GJJ/I3EC916LVxrawwgoAFiAlkOhOJ1jy5
	 BWh6t6wms26VyUFfp/jTA/1NNvm/MuRpAgucxZRHuYCwLkuED6NL1yFlWf5w3yVbUcpSv
	 43kfm+kt9221uXp5bfqO3cn1XriA1oVIplEKBdlaB1iwepkL4KbkuJ8W8Rd3u+wkZ7/X/
	 8UdqkPN7a0DCuwGOvDHei4A6FnPjKAfozH9y7/gSqEeDF2gzJysts14Dq9kqI5iLWsQ==
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=NGb5aMol;
	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 0B705606A31E;
	Wed, 28 Oct 2026 14:44:12 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F50F1F01825;
	Wed, 28 Oct 2026 14:44:10 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793198652;
	bh=1Q63vKXI7sX2+wwKEnsnoKjs6AlzUnkR62wP2YbR8PI=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=NGb5aMoljz5/21SSjR4odbTS26vwx/CGKuiRCOIeiUV4PASm6HyPxqlwerkkE1MH3
	 Y5YRwMYHUWqExx45xZAZYQZcxpfUDr0IHHIWhUE1yEHd5wfl0yao4lvoXpJZt0SV9s
	 xUewWoh/TQAG/AgtMd4kkX5J7jOi4DkmW9KM4t0PLUzuHOCK47gYnep3+m7uLTxU0B
	 rM+zptalztzrW4Tqxbc6LOXQ2zW2JusZZu657UZtlWQzUW+0Gh3KEz5FNrlxq3w2a3
	 zDlLs7AT1D5WC+kYIjdjEFKRwHtmzHXbAAybbva4ZoS+8P1mb5L6YFDJmBnuCggSsY
	 mj/zlUAgUgJdQ==
X-Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, Willem de Bruijn <willemb@google.com>,
	linux-ppp@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>,
	Qingfang Deng <qingfang.deng@linux.dev>,
	Felix Fietkau <nbd@nbd.name>,
	Pablo Neira Ayuso <pablo@netfilter.org>
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
X-In-Reply-To: <20261026155927.707655-1-edumazet@kernel.org>