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&#39;.]<br />
<br />
GCC warns that `val&#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&#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.
Impact
Base Score 3.x
6.30
Severity 3.x
MEDIUM
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) |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db
- https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3
- https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f
- https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff
- https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6
- https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2
- https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db
- https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3
- https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f
- https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff
- https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6
- https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html



