bpf: reject short IPv4/IPv6 inputs in bpf_prog_test_run_skb
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fa5cb548ced61b9d3095f32f8a7e427a248c65ee · < 8042240412de3222d27b31e89d29336961cad9e4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: reject short IPv4/IPv6 inputs in bpf_prog_test_run_skb
bpf_prog_test_run_skb() calls eth_type_trans() first and then uses skb->protocol to initialize sk family and address fields for the test run.
For IPv4 and IPv6 packets, it may access ip_hdr(skb) or ipv6_hdr(skb) even when the provided test input only contains an Ethernet header.
Reject the input earlier if the Ethernet frame carries IPv4/IPv6 EtherType but the L3 header is too short.
Fold the IPv4/IPv6 header length checks into the existing protocol switch and return -EINVAL before accessing the network headers.
From the CVE record · Linux
The Linux kernel’s bpf_prog_test_run_skb() may access an IPv4 or IPv6 header when test input contains only an Ethernet header. This can occur when a supplied Ethernet frame indicates IPv4 or IPv6 but its network-layer header is too short. The input does not specify whether an attacker can trigger this remotely or whether authentication is required.
Engineers running Linux kernels with bpf_prog_test_run_skb() should check whether their kernel includes the fix; affected versions are not specified.