From: Simon Horman <horms@kernel.org>
To: Eric Dumazet <edumazet@kernel.org>
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>
Subject: Re: [PATCH v2 net] ppp: linearize and segment bridged packets when required
Date: Wed, 28 Oct 2026 14:44:08 +0000 [thread overview]
Message-ID: <20261028144408.GX257209@horms.kernel.org> (raw)
In-Reply-To: <20261026155927.707655-1-edumazet@kernel.org>
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>
prev parent reply other threads:[~2026-10-28 14:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 15:59 [PATCH v2 net] ppp: linearize and segment bridged packets when required Eric Dumazet
2026-10-28 14:44 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028144408.GX257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-ppp@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=qingfang.deng@linux.dev \
--cc=sashiko-bot@kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox