gue: validate REMCSUM private option length
Subsystems (2)
PATCH 1/1 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.
--- include/net/gue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/gue.h +1 -1
@@ -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)
Signature · 1 line
2.50.1 (Apple Git-155)
Quoted 10 lines · Qihang
GUE private flags can indicate that remote checksum offload metadata is present. The private flags field itself is accounted for by
guehdr_flags_len(), butguehdr_priv_flags_len()currently returns 0 even whenGUE_PFLAG_REMCSUMis set.This lets a packet with only the private flags field pass
validate_gue_flags(), after whichgue_remcsum()andgue_gro_remcsum()read the missing REMCSUM start/offset fields from the following bytes.
Quoted 6 lines
Account for
GUE_PLEN_REMCSUMwhenGUE_PFLAG_REMCSUMis present so that malformed packets are rejected during option validation.Fixes c1aa8347e73e ("gue: Protocol constants for remote checksum offload")Signed-off-by Qihang <[email protected]>---
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 10 lines · On Wed, 1 Jul 2026 10:26:17 +0800 you wrote:
GUE private flags can indicate that remote checksum offload metadata is present. The private flags field itself is accounted for by
guehdr_flags_len(), butguehdr_priv_flags_len()currently returns 0 even whenGUE_PFLAG_REMCSUMis set.This lets a packet with only the private flags field pass
validate_gue_flags(), after whichgue_remcsum()andgue_gro_remcsum()read the missing REMCSUM start/offset fields from the following bytes.[...]
Here is the summary with links:
- [net] gue: validate REMCSUM private option length
https://git.kernel.org/netdev/net/c/d335dcc6f521
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html