]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
openvswitch: fix GSO userspace truncation underflow
authorKyle Zeng <kylebot@openai.com>
Tue, 7 Jul 2026 22:16:35 +0000 (15:16 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 21 Jul 2026 08:25:25 +0000 (10:25 +0200)
commit4032f8ed10fcb84d41c508dfb04be96589f78dfe
treeaf551987cb0614bb9afed0b480cf9c1547c8ac78
parentd163725af84ad958bb74ef4f6eb906a04daa8902
openvswitch: fix GSO userspace truncation underflow

OVS_ACTION_ATTR_TRUNC currently stores a delta from the original skb
length in OVS_CB(skb)->cutlen. When a later userspace action segments a
GSO skb, queue_gso_packets() reuses that delta for each smaller segment.
A segment can then reach queue_userspace_packet() with cutlen greater
than skb->len, underflowing the length passed to skb_zerocopy().

Store the maximum preserved length instead and bound each consumer
against the current skb length. Use U32_MAX as the no-truncation
sentinel so the value remains valid if skb geometry changes before a
consumer handles it.

Fixes: f2a4d086ed4c ("openvswitch: Add packet truncation support.")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.5
Signed-off-by: Kyle Zeng <kylebot@openai.com>
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/20260707221635.27489-1-kylebot@openai.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/openvswitch/actions.c
net/openvswitch/datapath.c
net/openvswitch/datapath.h
net/openvswitch/vport.c