Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: don't strip zerocopy frag markers from a forwarded skb
@ 2026-08-13  5:41 Norbert Szetei
  2026-08-13  5:47 ` [PATCH net 1/2] openvswitch: only skb_tx_error() a packet we are about to drop Norbert Szetei
  0 siblings, 1 reply; 9+ messages in thread
From: Norbert Szetei @ 2026-08-13  5:41 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Aaron Conole, Eelco Chaudron, Ilya Maximets,
	Steffen Klassert, Kuan-Ting Chen, Zoltan Kiss, dev, linux-kernel

queue_userspace_packet() calls skb_tx_error() on the packet skb in its
error path, but it only borrows that skb: on the OVS_ACTION_ATTR_USERSPACE
action path do_execute_actions() ignores output_userspace()'s return value
and keeps forwarding the same skb through the flow's remaining actions.
skb_tx_error() completes the zerocopy uarg and clears SKBFL_ALL_ZEROCOPY,
and with it SKBFL_SHARED_FRAG.

For a MSG_ZEROCOPY skb carrying page-cache frags, SKBFL_SHARED_FRAG is
what makes esp_input() skb_cow_data() instead of taking the in-place AEAD
path. Once it is stripped, a later local ESP delivery decrypts in place
over pages the sender still shares with the page cache.

Patch 1 moves the skb_tx_error() into the one path that does drop the
packet, the "default" arm of ovs_dp_process_packet()'s switch(error).

Patch 2 removes a second such strip, in skb_zerocopy(), which calls
skb_tx_error() on its source when skb_orphan_frags() fails. A copy helper
should not perform a destructive action on its source, and both callers
already report the error on their own drop path. MSG_ZEROCOPY skbs cannot
reach that one -- SKBFL_DONT_ORPHAN makes skb_orphan_frags() return early
-- but producers that do not set that flag, such as af_packet's TX_RING
path, can.

Norbert Szetei (2):
  openvswitch: only skb_tx_error() a packet we are about to drop
  net: skbuff: don't skb_tx_error() the source skb in skb_zerocopy()

 net/core/skbuff.c          | 5 ++---
 net/openvswitch/datapath.c | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-14 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13  5:41 [PATCH net 0/2] net: don't strip zerocopy frag markers from a forwarded skb Norbert Szetei
2026-08-13  5:47 ` [PATCH net 1/2] openvswitch: only skb_tx_error() a packet we are about to drop Norbert Szetei
2026-08-13  5:49   ` [PATCH net 2/2] net: skbuff: don't skb_tx_error() the source skb in skb_zerocopy() Norbert Szetei
2026-08-13 10:01     ` Ilya Maximets
2026-08-13 10:00   ` [PATCH net 1/2] openvswitch: only skb_tx_error() a packet we are about to drop Ilya Maximets
2026-08-14 11:01     ` Norbert Szetei
2026-08-14 12:31       ` Ilya Maximets
2026-08-14 13:40         ` Norbert Szetei
2026-08-14 14:52           ` Ilya Maximets

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox