CVE-2024-42161 Details
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.
A vulnerability has been identified in the Linux kernel's BPF (Berkeley Packet Filter) subsystem. The issue arises from the BPF_CORE_READ_BITFIELD macro, which may use an uninitialized variable, 'val'. This vulnerability is present in several versions of the Linux kernel, including the latest stable release. The root cause is a missing default case in a switch statement that handles different byte sizes, leaving 'val' potentially undefined. Exploitation could lead to unpredictable behavior, as 'val' could contain random values.
The vulnerability has been fixed in the Linux kernel. Users can upgrade to the latest version of the kernel to address this issue.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Sep 10, 2024References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-908 | Use of Uninitialized Resource | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| linux 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 |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | kernel.org |
| Nov 3, 2025 | CVE Modified | CVE |
| Nov 21, 2024 | CVE Modified | CVE |
| Sep 25, 2024 | Reanalysis | [email protected] |
| Aug 5, 2024 | Initial Analysis | [email protected] |
| Jul 30, 2024 | New CVE Received | kernel.org |