CVE-2024-42161

Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
30/07/2024
Last modified:
03/11/2025

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD<br /> <br /> [Changes from V1:<br /> - Use a default branch in the switch statement to initialize `val&amp;#39;.]<br /> <br /> GCC warns that `val&amp;#39; may be used uninitialized in the<br /> BPF_CRE_READ_BITFIELD macro, defined in bpf_core_read.h as:<br /> <br /> [...]<br /> unsigned long long val; \<br /> [...] \<br /> switch (__CORE_RELO(s, field, BYTE_SIZE)) { \<br /> case 1: val = *(const unsigned char *)p; break; \<br /> case 2: val = *(const unsigned short *)p; break; \<br /> case 4: val = *(const unsigned int *)p; break; \<br /> case 8: val = *(const unsigned long long *)p; break; \<br /> } \<br /> [...]<br /> val; \<br /> } \<br /> <br /> This patch adds a default entry in the switch statement that sets<br /> `val&amp;#39; to zero in order to avoid the warning, and random values to be<br /> used in case __builtin_preserve_field_info returns unexpected values<br /> for BPF_FIELD_BYTE_SIZE.<br /> <br /> Tested in bpf-next master.<br /> No regressions.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.10.222 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.11 (including) 5.15.163 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 6.1.98 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.2 (including) 6.6.39 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 (including) 6.9.9 (excluding)