Skip to main content
Vulnerability Database/CVE-2024-42148

CVE-2024-42148: Linux Kernel Buffer Overflow Vulnerability

CVE-2024-42148 is a buffer overflow flaw in Linux Kernel affecting the bnx2x Ethernet driver on systems with 32+ CPU cores. This vulnerability causes array out-of-bounds access. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-42148 Overview

CVE-2024-42148 is an out-of-bounds array access vulnerability in the Linux kernel's bnx2x Broadcom NetXtreme II 10Gb Ethernet driver. The flaw triggers Undefined Behavior Sanitizer (UBSAN) warnings when systems have 32 or more physical CPU cores, or when administrators set the num_queues module parameter to a value greater than or equal to FP_SB_MAX_E1x. The driver was updated to leverage E2 controller capabilities with more fast-path status blocks, but the stats_query_entry query array inside bnx2x_fw_stats_req was never resized, remaining limited to E1x dimensions ([CWE-129]). This creates read and write operations past the 19-element array boundary.

Critical Impact

Local out-of-bounds read and write in kernel space on affected Broadcom E2 NIC configurations, impacting kernel memory confidentiality, integrity, and availability.

Affected Products

  • Linux kernel versions containing the bnx2x driver prior to the fix commits
  • Systems using Broadcom NetXtreme II 10Gb (57712 / E2 controller) adapters
  • Hosts with 32+ physical CPU cores running the vulnerable driver

Discovery Timeline

  • 2024-07-30 - CVE-2024-42148 published to the National Vulnerability Database
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-42148

Vulnerability Analysis

The vulnerability is an array-index-out-of-bounds condition in drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c at line 1529. The struct stats_query_entry query array is declared with size FP_SB_MAX_E1x + BNX2X_FIRST_QUEUE_QUERY_IDX, which equals 16 + 3 = 19 entries. Accesses into the array are offset by BNX2X_FIRST_QUEUE_QUERY_IDX, so the usable Ethernet queue slots are capped at 16. When the driver runs on an E2 controller or when num_queues is pushed beyond that bound, index values such as 20 are written into a 19-element structure. UBSAN reports confirm the overflow on systems such as the HP ProLiant DL360 Gen9 under kernel 6.9.0-rc7.

Root Cause

Support for the E2 controller was originally added using E1x parameters, where FP_SB_MAX_E2 matched FP_SB_MAX_E1x. Later changes expanded the driver to use the larger fast-path status block count available on E2 hardware, but the stats_query_entry query array was not resized accordingly. The driver advertises more queues than the stats array can hold, leading to indexed writes beyond the allocated buffer.

Attack Vector

The issue requires local access with privileges to load kernel modules or configure driver parameters, or deployment on a host whose core count naturally forces the driver into the overflow path. There is no remote exploitation vector. A local user able to influence num_queues on a system with the affected hardware can trigger the out-of-bounds access and potentially corrupt adjacent kernel memory.

No public proof-of-concept exploit code is available. The vulnerability pattern is documented in the upstream commit messages and the Linux kernel UBSAN stack traces reproduced in the advisory.

Detection Methods for CVE-2024-42148

Indicators of Compromise

  • Kernel log entries of the form UBSAN: array-index-out-of-bounds in drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c:1529:11
  • Messages indicating index <N> is out of range for type 'stats_query_entry [19]'
  • Unexpected bnx2x driver crashes or network interface resets on hosts with Broadcom 57712 or similar E2 NICs

Detection Strategies

  • Enumerate kernel versions and loaded bnx2x module versions across the fleet and compare against patched stable branches referenced in the upstream commits.
  • Inspect /var/log/kern.log, dmesg, or journalctl -k output for UBSAN warnings referencing bnx2x_stats.c.
  • Flag hosts that have Broadcom E2-class NICs combined with 32 or more CPU cores or a non-default num_queues module parameter.

Monitoring Recommendations

  • Forward kernel ring buffer messages to a centralized logging platform and alert on UBSAN or bnx2x oops signatures.
  • Monitor loaded kernel modules and their parameters via configuration-management tooling to detect num_queues values at or above 16.
  • Track network interface error counters and link flaps on affected adapters to spot driver instability.

How to Mitigate CVE-2024-42148

Immediate Actions Required

  • Apply the kernel update that resizes the stats_query_entry query array to use FP_SB_MAX_E2, as shipped in the upstream stable branches.
  • Restrict load-time parameters of the bnx2x module so that num_queues cannot be set beyond safe bounds pending a reboot into a patched kernel.
  • Audit hosts with Broadcom 57712/E2 NICs and 32+ CPU cores and prioritize them for patching.

Patch Information

The fix is delivered in multiple upstream Linux stable commits, including 0edae06b4c22, 134061163ee5, 8b17cec33892, 9504a1550686, b9ea38e76745, cbe53087026a, cfb04472ce33, and f1313ea92f82. Distributions have also published rebuilt packages, including the Debian LTS Announcement.

Workarounds

  • Blacklist the bnx2x module on hosts that do not require the affected adapters until a patched kernel is deployed.
  • Keep num_queues at the driver default on vulnerable kernels; avoid raising it to the maximum supported by E2 hardware.
  • Where feasible, limit scheduler visibility of CPUs for bnx2x interrupt steering so that the driver does not provision queues beyond the 19-slot stats array.
bash
# Configuration example
# Prevent the vulnerable driver from loading on unpatched hosts
echo 'blacklist bnx2x' | sudo tee /etc/modprobe.d/blacklist-bnx2x.conf
sudo update-initramfs -u

# Or, if the driver must remain loaded, pin num_queues to a safe value
echo 'options bnx2x num_queues=8' | sudo tee /etc/modprobe.d/bnx2x.conf
sudo modprobe -r bnx2x && sudo modprobe bnx2x

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.