CVE-2024-42161
Linux kernel BPF uninitialized value vulnerability
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.
INFO
Published Date :
July 30, 2024, 8:15 a.m.
Last Modified :
Nov. 21, 2024, 9:33 a.m.
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Remotely Exploitable :
No
Impact Score :
5.5
Exploitability Score :
0.8
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2024-42161
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2024-42161
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2024-42161
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db Added Reference https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3 Added Reference https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f Added Reference https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff Added Reference https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6 Added Reference https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2 -
Reanalysis by [email protected]
Sep. 25, 2024
Action Type Old Value New Value Removed CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Added CVSS V3.1 NIST AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H -
Initial Analysis by [email protected]
Aug. 05, 2024
Action Type Old Value New Value Added CVSS V3.1 NIST AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Changed Reference Type https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db No Types Assigned https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db Patch Changed Reference Type https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3 No Types Assigned https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3 Patch Changed Reference Type https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f No Types Assigned https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f Patch Changed Reference Type https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff No Types Assigned https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff Patch Changed Reference Type https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6 No Types Assigned https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6 Patch Changed Reference Type https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2 No Types Assigned https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2 Patch Added CWE NIST CWE-908 Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions up to (excluding) 5.10.222 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.11 up to (excluding) 5.15.163 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 5.16 up to (excluding) 6.1.98 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.2 up to (excluding) 6.6.39 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.7 up to (excluding) 6.9.9 -
CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Jul. 30, 2024
Action Type Old Value New Value Added 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. Added Reference kernel.org https://git.kernel.org/stable/c/b694989bb13ed5f166e633faa1eb0f21c6d261a6 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/3364c2ed1c241989847f19cf83e3db903ce689e3 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/a21d76bd0b0d39518e9a4c19f6cf7c042a974aff [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/7e5471b5efebc30dd0bc035cda86693a5c73d45f [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/ff941a8449e712eaf7efca1a13bfb9afd3d99fc2 [No types assigned] Added Reference kernel.org https://git.kernel.org/stable/c/009367099eb61a4fc2af44d4eb06b6b4de7de6db [No types assigned]
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2024-42161
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2024-42161
weaknesses.