CVE-2022-49340

Source
https://cve.org/CVERecord?id=CVE-2022-49340
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49340.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49340
Downstream
Published
2025-02-26T02:10:57.322Z
Modified
2026-03-20T12:22:21.920484Z
Summary
ip_gre: test csum_start instead of transport header
Details

In the Linux kernel, the following vulnerability has been resolved:

ipgre: test csumstart instead of transport header

GRE with TUNNELCSUM will apply local checksum offload on CHECKSUMPARTIAL packets.

ipgrexmit must validate csumstart after an optional skbpull, else lcocsum may trigger an overflow. The original check was

if (csum && skb_checksum_start(skb) < skb->data)
    return -EINVAL;

This had false positives when skbchecksumstart is undefined: when ipsummed is not CHECKSUMPARTIAL. 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 headerops and calls skbpull. - test skbtransportheader, which is set along with csumstart in skbpartialcsumset in the normal header_ops datapath.

Turns out skbs can arrive in this branch without the transport header set, e.g., through BPF redirection.

Revise the check back to check csumstart directly, and only if CHECKSUMPARTIAL. Do leave the check in the updated location. Check field regardless of whether TUNNEL_CSUM is configured.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49340.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
774430026bd9a472d08c5d3c33351a782315771a
Fixed
7596bd7920985f7fc8579a92e48bc53ce4475b21
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
3d32ce5472bb2ca720bef84089b85f76a705fd1a
Fixed
3d08bc3a5d9b2106f5c8bcf1adb73147824aa006
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
87b34cd6485192777f632f92d592f2a71d8801a6
Fixed
fbeb8dfa8b87ef259eef0c89e39b53962a3cf604
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
8a0ed250f911da31a2aef52101bc707846a800ff
Fixed
e6b6f98fc7605c06c0a3baa70f62c534d7b4ce58
Fixed
0c92d813c7c9ca2212ecd879232e7d87362fce98
Fixed
0ffa268724656633af5f37a38c212326d98ebe8c
Fixed
8d21e9963bec1aad2280cdd034c8993033ef2948
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
4bf5d5224ffca069df4501ba5fcc6ded9c002ead

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49340.json"