CVE-2024-42161: bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD
Vulnerability summary
CVE-2024-42161 is a medium (CVSS 6.3) Use of Uninitialized Resource vulnerability in linux. EPSS estimates a 0.22% chance of exploitation in the next 30 days, higher than 12.6% of scored vulnerabilities.
Not severe (CVSS 6.3, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 28 · Related 24Timeline
- 30-07-2024PublishedVulnerability first disclosed.
- 11-05-2026Last modifiedVulnerability information updated.
Description
In the Linux kernel, the following vulnerability has been resolved: bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD [Changes from V1: - Use a default branch in the switch statement to initialize `val'.] GCC warns that `val' may be used uninitialized in the BPF_CRE_READ_BITFIELD macro, defined in bpf_core_read.h as: [...] unsigned long long val; \ [...] \ switch (__CORE_RELO(s, field, BYTE_SIZE)) { \ case 1: val = *(const unsigned char *)p; break; \ case 2: val = *(const unsigned short *)p; break; \ case 4: val = *(const unsigned int *)p; break; \ case 8: val = *(const unsigned long long *)p; break; \ } \ [...] val; \ } \ This patch adds a default entry in the switch statement that sets `val' to zero in order to avoid the warning, and random values to be used in case __builtin_preserve_field_info returns unexpected values for BPF_FIELD_BYTE_SIZE. Tested in bpf-next master. No regressions.
CVSS metrics
3 scores · 3 sources · 1 version- OSV · UbuntuEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H
- OSV · DebianEcosystem advisory · calculated6.3MediumCVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H
EPSS trend
Probability
0.22%
Chance of exploitation in the next 30 days
Percentile
13%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.22% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, administrative account, no user interaction (CVSS vector). Other conditions: not stated in public data.
Ubuntu117 products
- linux< 5.15.0-121.131 | < 6.8.0-48.48
- linux-allwinner-5.19All versions (No fix recorded)
- linux-aws< 5.15.0-1069.75 | < 6.8.0-1018.20
- linux-aws-5.0All versions (No fix recorded)
- linux-aws-5.11All versions (No fix recorded)
Linux2 products
- linux≥ ee26dade0e3bcd8a34ae7520e373fb69365fce7a, < b694989bb13ed5f166e633faa1eb0f21c6d261a6 | ≥ ee26dade0e3bcd8a34ae7520e373fb69365fce7a, < 3364c2ed1c241989847f19cf83e3db903ce689e3 | ≥ ee26dade0e3bcd8a34ae7520e373fb69365fce7a, < a21d76bd0b0d39518e9a4c19f6cf7c042a974aff | ≥ ee26dade0e3bcd8a34ae7520e373fb69365fce7a, < 7e5471b5efebc30dd0bc035cda86693a5c73d45f | ≥ ee26dade0e3bcd8a34ae7520e373fb69365fce7a, < ff941a8449e712eaf7efca1a13bfb9afd3d99fc2 | ≥ ee26dade0e3bcd8a34ae7520e373fb69365fce7a, < 009367099eb61a4fc2af44d4eb06b6b4de7de6db | 5.5
- linux_kernel< 5.10.222 | ≥ 5.11, < 5.15.163 | ≥ 5.16, < 6.1.98 | ≥ 6.2, < 6.6.39 | ≥ 6.7, < 6.9.9
Debian1 product
- linux< 6.1.98-1 | < 6.9.9-1
3 vendors · 120 products