diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2026-10-06 15:35:42 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-06 15:35:42 -0700 |
| commit | ab699d296e066eb64f51d2a8a1d42237a3b186c8 (patch) | |
| tree | 2e805ac724e4a0117bd54fb547a580f31700716a /tools/perf/scripts/python/task-analyzer.py | |
| parent | d5a007b9b457c915ab1a53227e8939e4018aa97a (diff) | |
| parent | ee2d4c2d7cc18a2cd504044a75ea614e720248eb (diff) | |
| download | linux-ab699d296e066eb64f51d2a8a1d42237a3b186c8.tar.gz linux-ab699d296e066eb64f51d2a8a1d42237a3b186c8.zip | |
Merge branch 'net-always-dissect-gso-packets-in-__virtio_net_hdr_to_skb'
Eric Dumazet says:
====================
net: always dissect GSO packets in __virtio_net_hdr_to_skb()
This series fixes a bypass of untrusted GSO flow dissection in
__virtio_net_hdr_to_skb() when VIRTIO_NET_HDR_F_NEEDS_CSUM is not set,
and adds a kselftest covering VLAN-tagged GSO packets without NEEDS_CSUM:
- Patch 1 fixes __skb_flow_dissect(), which computes key_control->thoff
with min_t(u16, ...). This truncates skb->len and returns a bogus small
transport offset when skb->len modulo 65536 is smaller than the
transport offset. Offsets that do not fit in the u16 thoff now fail the
dissection instead of being silently truncated.
- Patch 2 initializes skb->dev and skb->network_header before calling
virtio_net_hdr_*_to_skb() in tun_get_user(), tun_xdp_one(),
virtnet_receive_done(), and raw_verify_header(), removes the
'&& skb->network_header' condition and the unvalidated
'else if (gso_type)' fallback in __virtio_net_hdr_to_skb(), and moves
virtio_net_hdr_match_proto() after skb_flow_dissect_flow_keys_basic()
so it validates the dissected L3 protocol (keys.basic.n_proto) rather
than the outer L2 protocol.
- Patch 3 adds kselftests in tools/testing/selftests/net/tun.c verifying
that VLAN-tagged (802.1Q) TCPv4 GSO packets without NEEDS_CSUM (both
flags = 0 and flags = VIRTIO_NET_HDR_F_DATA_VALID) are accepted on a
TAP device, that mismatched GSO types and truncated TCP headers without
NEEDS_CSUM are rejected with -EINVAL, and that a 65540-byte frame is
accepted.
====================
Link: https://patch.msgid.link/20261001191140.2818991-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
