net: preserve MSG_ZEROCOPY with forwarding
authorWillem de Bruijn <willemb@google.com>
Mon, 30 Jun 2025 19:42:11 +0000 (15:42 -0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Jul 2025 22:07:16 +0000 (15:07 -0700)
commitd2527ad3a9e1f3031095d65376a94a8e640b2b74
tree3d06f71669aa0782dd6864a351ac90d985a836a0
parent04b1d18c5bae0e3c40207953658b1f62182d4829
net: preserve MSG_ZEROCOPY with forwarding

MSG_ZEROCOPY data must be copied before data is queued to local
sockets, to avoid indefinite timeout until memory release.

This test is performed by skb_orphan_frags_rx, which is called when
looping an egress skb to packet sockets, error queue or ingress path.

To preserve zerocopy for skbs that are looped to ingress but are then
forwarded to an egress device rather than delivered locally, defer
this last check until an skb enters the local IP receive path.

This is analogous to existing behavior of skb_clear_delivery_time.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250630194312.1571410-2-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c
net/ipv4/ip_input.c
net/ipv6/ip6_input.c