Menu

Star on GitHub · 3.2k

CVE-2024-42161

6.3 · MEDIUM

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 i…

Published Jul 30, 2024CWE-908EPSS 0.22%

Overview

CVE-2024-42161 is a medium-severity vulnerability. It was published on July 30, 2024 and has a CVSS 3.1 base score of 6.3 (MEDIUM).

This vulnerability has a CVSS 3.1 base score of 6.3, rated MEDIUM. It requires local or adjacent network access to exploit. Some level of privileges is required for exploitation.

Technical 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.

Remediation

Check the references section for vendor advisories, patches, and mitigation guidance. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

Frequently asked questions

What is CVE-2024-42161?

CVE-2024-42161 is a medium-severity vulnerability. It was published on July 30, 2024 and has a CVSS 3.1 base score of 6.3 (MEDIUM).

How severe is CVE-2024-42161?

This vulnerability has a CVSS 3.1 base score of 6.3, rated MEDIUM. It requires local or adjacent network access to exploit. Some level of privileges is required for exploitation.

How do I fix or remediate CVE-2024-42161?

Check the references section for vendor advisories, patches, and mitigation guidance. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

How can CyberStrike help with CVE-2024-42161?

CyberStrike is an open-source, AI-augmented pentesting engine. Rather than flag a version number, it tests whether an issue like CVE-2024-42161 is actually reachable in your own applications and APIs, then verifies each finding before reporting it. That tells you if the weakness is a real, exploitable risk in your environment or a false positive you can safely deprioritize.

Related MEDIUM CVEs from 2024

View all