diff options
| author | Qihang <q.h.hack.winter@gmail.com> | 2026-07-01 10:26:17 +0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2026-07-03 09:34:53 +0100 |
| commit | d335dcc6f521571d57117b8deeebc940836e5450 (patch) | |
| tree | 5721894c1fa9a8b86b03103da5d4265bca756f09 /include | |
| parent | 62e7df6d042aeebd5efb581074e28865c04477be (diff) | |
| download | lwn-d335dcc6f521571d57117b8deeebc940836e5450.tar.gz lwn-d335dcc6f521571d57117b8deeebc940836e5450.zip | |
gue: validate REMCSUM private option length
GUE private flags can indicate that remote checksum offload metadata is
present. The private flags field itself is accounted for by
guehdr_flags_len(), but guehdr_priv_flags_len() currently returns 0 even
when GUE_PFLAG_REMCSUM is set.
This lets a packet with only the private flags field pass
validate_gue_flags(), after which gue_remcsum() and gue_gro_remcsum()
read the missing REMCSUM start/offset fields from the following bytes.
Account for GUE_PLEN_REMCSUM when GUE_PFLAG_REMCSUM is present so that
malformed packets are rejected during option validation.
Fixes: c1aa8347e73e ("gue: Protocol constants for remote checksum offload")
Signed-off-by: Qihang <q.h.hack.winter@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/gue.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/gue.h b/include/net/gue.h index dfca298bec9c..caefd6da8693 100644 --- a/include/net/gue.h +++ b/include/net/gue.h @@ -80,7 +80,7 @@ static inline size_t guehdr_flags_len(__be16 flags) static inline size_t guehdr_priv_flags_len(__be32 flags) { - return 0; + return (flags & GUE_PFLAG_REMCSUM) ? GUE_PLEN_REMCSUM : 0; } /* Validate standard and private flags. Returns non-zero (meaning invalid) |
