Menu

Star on GitHub · 3.4k

CVE-2024-38540

4.4 · MEDIUM

In the Linux kernel, the following vulnerability has been resolved: bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq Undefined behavior is triggered when bnxt_qplib_alloc_init…

Published Jun 19, 2024EPSS 0.25%

Overview

CVE-2024-38540 is a medium-severity vulnerability. It was published on June 19, 2024 and has a CVSS 3.1 base score of 4.4 (MEDIUM).

This vulnerability has a CVSS 3.1 base score of 4.4, 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:

bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq

Undefined behavior is triggered when bnxt_qplib_alloc_init_hwq is called

with hwq_attr->aux_depth != 0 and hwq_attr->aux_stride == 0.

In that case, "roundup_pow_of_two(hwq_attr->aux_stride)" gets called.

roundup_pow_of_two is documented as undefined for 0.

Fix it in the one caller that had this combination.

The undefined behavior was detected by UBSAN:

UBSAN: shift-out-of-bounds in ./include/linux/log2.h:57:13

shift exponent 64 is too large for 64-bit type 'long unsigned int'

CPU: 24 PID: 1075 Comm: (udev-worker) Not tainted 6.9.0-rc6+ #4

Hardware name: Abacus electric, s.r.o. - [email protected] Super Server/H12SSW-iN, BIOS 2.7 10/25/2023

Call Trace:

<TASK>

dump_stack_lvl+0x5d/0x80

ubsan_epilogue+0x5/0x30

__ubsan_handle_shift_out_of_bounds.cold+0x61/0xec

__roundup_pow_of_two+0x25/0x35 [bnxt_re]

bnxt_qplib_alloc_init_hwq

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-38540?

CVE-2024-38540 is a medium-severity vulnerability. It was published on June 19, 2024 and has a CVSS 3.1 base score of 4.4 (MEDIUM).

How severe is CVE-2024-38540?

This vulnerability has a CVSS 3.1 base score of 4.4, 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-38540?

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-38540?

CyberStrike is an open-source, AI-augmented pentesting engine. Rather than flag a version number, it tests whether an issue like CVE-2024-38540 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
LiveWatch live →