linux/net/openvswitch
Kyle Zeng 4032f8ed10 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: f2a4d086ed ("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>
2026-07-21 10:25:25 +02:00
..
actions.c openvswitch: fix GSO userspace truncation underflow 2026-07-21 10:25:25 +02:00
conntrack.c openvswitch: conntrack: annotate ct limit hlist traversal 2026-06-25 08:38:00 -07:00
conntrack.h
datapath.c openvswitch: fix GSO userspace truncation underflow 2026-07-21 10:25:25 +02:00
datapath.h openvswitch: fix GSO userspace truncation underflow 2026-07-21 10:25:25 +02:00
dp_notify.c net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
drop.h net: openvswitch: add misc error drop reasons 2023-08-14 08:01:06 +01:00
flow_netlink.c net: openvswitch: reject oversized nested action attrs 2026-07-11 13:09:11 +02:00
flow_netlink.h net: openvswitch: remove never-working support for setting nsh fields 2025-11-14 18:13:24 -08:00
flow_table.c net: use get_random_u{16,32,64}() where appropriate 2026-04-09 19:27:43 -07:00
flow_table.h net: openvswitch: Annotate struct mask_array with __counted_by 2023-10-17 13:56:03 +02:00
flow.c net: openvswitch: Use for_each_cpu() where appropriate 2025-08-20 19:47:22 -07:00
flow.h
Kconfig sctp: use skb_crc32c() instead of __skb_checksum() 2025-05-21 15:40:16 -07:00
Makefile
meter.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
meter.h net: openvswitch: remove unnecessary linux/genetlink.h include 2024-04-01 21:44:34 -07:00
openvswitch_trace.c
openvswitch_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
vport-geneve.c openvswitch: vport: fix race between tunnel creation and linking 2026-05-05 15:14:33 +02:00
vport-gre.c openvswitch: vport: fix race between tunnel creation and linking 2026-05-05 15:14:33 +02:00
vport-internal_dev.c net: rename netns_local to netns_immutable 2025-03-04 12:44:48 +01:00
vport-internal_dev.h
vport-netdev.c openvswitch: vport: fix race between linking and the device notifier 2026-05-18 16:38:45 -07:00
vport-netdev.h openvswitch: vport: fix race between tunnel creation and linking 2026-05-05 15:14:33 +02:00
vport-vxlan.c openvswitch: vport: fix race between tunnel creation and linking 2026-05-05 15:14:33 +02:00
vport.c openvswitch: fix GSO userspace truncation underflow 2026-07-21 10:25:25 +02:00
vport.h net: openvswitch: fix kernel-doc warnings in internal headers 2025-03-24 09:30:21 -07:00