CVE-2024-47702: bpf: Fail verification for sign-extension of packet data/data_end/data_meta
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fail verification for sign-extension of packet data/data_end/data_meta
syzbot reported a kernel crash due to
commit 1f1e864b6555 ("bpf: Handle sign-extenstin ctx member accesses").
The reason is due to sign-extension of 32-bit load for
packet data/data_end/data_meta uapi field.
The original code looks like:
r2 = *(s32 *)(r1 + 76) /* load __sk_buff->data */
r3 = *(u32 *)(r1 + 80) /* load __sk_buff->data_end */
r0 = r2
r0 += 8
if r3 > r0 goto +1
...
Note that __sk_buff->data load has 32-bit sign extension.
After verification and convert_ctx_accesses(), the final asm code looks like:
r2 = *(u64 *)(r1 +208)
r2 = (s32)r2
r3 = *(u64 *)(r1 +80)
r0 = r2
r0 += 8
if r3 > r0 goto pc+1
...
Note that 'r2 = (s32)r2' may make the kernel __sk_buff->data address invalid
which may cause runtime failure.
Currently, in C code, typically we have
void *data = (void *)(long)skb->data;
void *data_end = (void *)(long)skb->data_end;
...
and it will generate
r2 = *(u64 *)(r1 +208)
r3 = *(u64 *)(r1 +80)
r0 = r2
r0 += 8
if r3 > r0 goto pc+1
If we allow sign-extension,
void *data = (void *)(long)(int)skb->data;
void *data_end = (void *)(long)skb->data_end;
...
the generated code looks like
r2 = *(u64 *)(r1 +208)
r2 <<= 32
r2 s>>= 32
r3 = *(u64 *)(r1 +80)
r0 = r2
r0 += 8
if r3 > r0 goto pc+1
and this will cause verification failure since "r2 <<= 32" is not allowed
as "r2" is a packet pointer.
To fix this issue for case
r2 = *(s32 *)(r1 + 76) /* load __sk_buff->data */
this patch added additional checking in is_valid_access() callback
function for packet data/data_end/data_meta access. If those accesses
are with sign-extenstion, the verification will fail.
[1] https://lore.kernel.org/bpf/000000000000c90eee061d236d37@google.com/
Security readout for executives and security teams
Plain-English summary
A Linux eBPF verifier flaw can allow an unsafe sign-extension operation on packet pointers, producing an invalid kernel address and potentially crashing the system. The supplied CVSS score is 7.8 because exploitation requires local, low-privileged access but could significantly affect confidentiality, integrity, and availability.
Executive priority
Prioritize internet-facing, multi-user, and shared-compute Linux systems where low-privileged users can access eBPF. Patch through normal emergency kernel processes after compatibility testing; accelerate remediation where untrusted local workloads are present.
Technical view
The verifier incorrectly accepted signed 32-bit loads of __sk_buff data, data_end, or data_meta fields. Context-access conversion could then sign-extend a packet pointer, making its kernel address invalid at runtime. The stable fix rejects these sign-extending accesses during verification.
Likely exposure
Exposure requires an affected Linux kernel and a local, low-privileged path capable of submitting the relevant eBPF program. The bundle identifies Linux 6.6, 6.10.13, 6.11.2, and 6.12 as affected, but does not provide complete distribution-specific package ranges.
Exploitation context
The supplied vector is local, low complexity, low privilege, and requires no user interaction. The bundle reports a syzbot-triggered kernel crash. It does not cite public exploitation, and CVE-2024-47702 is not identified as CISA KEV-listed in the supplied data.
Researcher notes
The flaw concerns verifier handling during context-access conversion, not ordinary packet parsing alone. The correction adds is_valid_access() checks that reject sign-extension for packet pointer fields. The bundle supplies three stable commits but does not map each commit to a specific kernel branch or distribution package.
Mitigation direction
Update to a vendor-supported kernel containing the applicable stable fix.
Confirm the selected distribution package includes the referenced upstream correction.
Until updated, restrict untrusted local users from loading eBPF programs where operationally feasible.
Monitor vendor advisories for distribution-specific affected and fixed package versions.
Validation and detection
Inventory kernel versions across hosts, containers, appliances, and managed images.
Compare each kernel package against its vendor advisory and fixed build.
Verify whether untrusted local users can load eBPF programs.
Confirm patched kernels reject sign-extending accesses to data, data_end, and data_meta.
Monitor affected systems for unexplained kernel crashes or related verifier diagnostics.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-47702 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.