diff options
| author | Kyle Zeng <kylebot@openai.com> | 2026-10-28 18:13:50 +0100 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-29 09:01:11 -0700 |
| commit | de788d8a7032475f900c16e9cc0c1417f4f719eb (patch) | |
| tree | 94268e9a16470ee8194995d4cb9b9bd5a5e51a5d /scripts/basic/split-include.c | |
| parent | dc4dd12f80e499dc034710cd8195489abcf0b059 (diff) | |
| download | linux-de788d8a7032475f900c16e9cc0c1417f4f719eb.tar.gz linux-de788d8a7032475f900c16e9cc0c1417f4f719eb.zip | |
gro: do not GRO GSO packets with inconsistent payload
tcp_gro_receive() excludes empty non-GSO packets with the unsigned
len - 1 check, but its GSO branch only checks that gso_size matches
the held packet's MSS. A trusted TCP GSO skb can reach GRO again with
no payload after TC pedit increases its TCP data offset.
If the skb is fully linear, skb_gro_receive() then enters its fragment
transfer path with nr_frags == 0. The do-while loop copies skb_frag_t
entries backwards beyond both fragment arrays. An unprivileged process
using its own user and network namespaces can trigger a KASAN
slab-out-of-bounds write and panic through veth, pedit and GRE.
More generally, the payload of such a packet can be shrunk to any
value, making it inconsistent with its gso_segs, and a GSO packet
with gso_segs == 0 contributes no segment to the GRO packet.
Do not aggregate GSO packets with gso_segs == 0, and require the
payload of GSO packets to be consistent with gso_segs and gso_size,
the last segment being allowed to be short. This rejects the empty
skb before either TCP merge helper, and covers both IPv4 and IPv6.
Fixes: 5eddb24901ee ("gro: add support of (hw)gro packets to gro stack")
Signed-off-by: Kyle Zeng <kylebot@openai.com>
[edumazet: check payload against gso_segs, refuse gso_segs == 0]
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20261028171350.2205175-1-edumazet@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
