ip_gre: test csum_start instead of transport header
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8a0ed250f911da31a2aef52101bc707846a800ff · < 0ffa268724656633af5f37a38c212326d98ebe8c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ip_gre: test csum_start instead of transport header
GRE with TUNNEL_CSUM will apply local checksum offload on CHECKSUM_PARTIAL packets.
ipgre_xmit must validate csum_start after an optional skb_pull, else lco_csum may trigger an overflow. The original check was
if (csum && skb_checksum_start(skb) < skb->data) return -EINVAL;
This had false positives when skb_checksum_start is undefined: when ip_summed is not CHECKSUM_PARTIAL. A discussed refinement was straightforward
if (csum && skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_start(skb) < skb->data) return -EINVAL;
But was eventually revised more thoroughly: - restrict the check to the only branch where needed, in an uncommon GRE path that uses header_ops and calls skb_pull. - test skb_transport_header, which is set along with csum_start in skb_partial_csum_set in the normal header_ops datapath.
From the CVE record · Linux
The Linux kernel's ip_gre path can mishandle checksum validation when a GRE packet reaches an uncommon header_ops path, including through BPF redirection. An skb without a transport header set can reach the checksum operation and trigger an overflow. The input does not establish whether exploitation requires network or local access, authentication, or user interaction.
Engineers running Linux kernels that may lack the ip_gre fix should check their versions against the vendor advisory; affected versions were not provided.