Skip to main content

CVE-2024-26787: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-26787cvecve-2024-26787
Published: Thu Apr 04 2024 (04/04/2024, 08:20:19 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mmc: mmci: stm32: fix DMA API overlapping mappings warning Turning on CONFIG_DMA_API_DEBUG_SG results in the following warning: DMA-API: mmci-pl18x 48220000.mmc: cacheline tracking EEXIST, overlapping mappings aren't supported WARNING: CPU: 1 PID: 51 at kernel/dma/debug.c:568 add_dma_entry+0x234/0x2f4 Modules linked in: CPU: 1 PID: 51 Comm: kworker/1:2 Not tainted 6.1.28 #1 Hardware name: STMicroelectronics STM32MP257F-EV1 Evaluation Board (DT) Workqueue: events_freezable mmc_rescan Call trace: add_dma_entry+0x234/0x2f4 debug_dma_map_sg+0x198/0x350 __dma_map_sg_attrs+0xa0/0x110 dma_map_sg_attrs+0x10/0x2c sdmmc_idma_prep_data+0x80/0xc0 mmci_prep_data+0x38/0x84 mmci_start_data+0x108/0x2dc mmci_request+0xe4/0x190 __mmc_start_request+0x68/0x140 mmc_start_request+0x94/0xc0 mmc_wait_for_req+0x70/0x100 mmc_send_tuning+0x108/0x1ac sdmmc_execute_tuning+0x14c/0x210 mmc_execute_tuning+0x48/0xec mmc_sd_init_uhs_card.part.0+0x208/0x464 mmc_sd_init_card+0x318/0x89c mmc_attach_sd+0xe4/0x180 mmc_rescan+0x244/0x320 DMA API debug brings to light leaking dma-mappings as dma_map_sg and dma_unmap_sg are not correctly balanced. If an error occurs in mmci_cmd_irq function, only mmci_dma_error function is called and as this API is not managed on stm32 variant, dma_unmap_sg is never called in this error path.

AI-Powered Analysis

AILast updated: 06/29/2025, 18:41:26 UTC

Technical Analysis

CVE-2024-26787 is a vulnerability identified in the Linux kernel's MMC (MultiMediaCard) subsystem, specifically affecting the STM32 variant of the mmci (MultiMediaCard Interface) driver. The issue arises from improper handling of DMA (Direct Memory Access) mappings during error conditions in the mmci_cmd_irq function. When an error occurs, the function mmci_dma_error is invoked; however, in the STM32 variant, this function does not properly unmap DMA scatter-gather lists using dma_unmap_sg, leading to a leak of DMA mappings. This is highlighted when the CONFIG_DMA_API_DEBUG_SG kernel configuration option is enabled, which triggers warnings about overlapping DMA mappings and cacheline tracking conflicts. The root cause is an imbalance between dma_map_sg and dma_unmap_sg calls, which violates the expected DMA API usage. The vulnerability manifests as a resource leak within the kernel's DMA subsystem, potentially causing system instability or degraded performance due to unreleased DMA mappings. The affected hardware is the STMicroelectronics STM32MP257F-EV1 Evaluation Board, but the underlying issue may impact other STM32-based Linux systems using the affected mmci driver code. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet. The vulnerability was published on April 4, 2024, and is resolved by correcting the DMA unmapping logic in the kernel source.

Potential Impact

For European organizations, the impact of CVE-2024-26787 depends largely on the deployment of Linux systems running on STM32-based hardware or similar embedded platforms using the affected mmci driver. While the vulnerability does not directly enable code execution or privilege escalation, the leaking of DMA mappings can lead to kernel resource exhaustion, potentially causing system instability, crashes, or degraded performance. This can affect embedded devices, industrial control systems, or IoT devices that rely on STM32 Linux platforms, which are increasingly used in sectors such as manufacturing, automotive, telecommunications, and critical infrastructure. Disruptions in these systems could lead to operational downtime, impacting business continuity and safety-critical processes. Although no active exploitation is known, the vulnerability's presence in kernel code used in embedded devices means that organizations with such deployments should prioritize remediation to avoid latent risks. The issue is less likely to affect general-purpose Linux servers or desktops but is significant for embedded and specialized Linux environments prevalent in European industrial and technological sectors.

Mitigation Recommendations

Mitigation requires updating the Linux kernel to a version where the DMA unmapping logic in the mmci STM32 driver has been corrected. Organizations should: 1) Identify all embedded Linux devices and systems using STM32 hardware or the affected mmci driver variant. 2) Apply vendor-supplied kernel patches or upgrade to the latest stable Linux kernel releases that include the fix for CVE-2024-26787. 3) Enable CONFIG_DMA_API_DEBUG_SG during testing phases to detect any DMA mapping imbalances proactively. 4) Implement monitoring for kernel warnings related to DMA mappings to detect potential leaks early. 5) For critical embedded systems, conduct thorough regression testing post-patch to ensure stability. 6) Coordinate with hardware vendors for firmware or driver updates if the affected devices are part of third-party products. 7) Maintain strict change management and incident response plans to quickly address any instability that may arise from this vulnerability or its remediation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-19T14:20:24.178Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982bc4522896dcbe3bd3

Added to database: 5/21/2025, 9:08:59 AM

Last enriched: 6/29/2025, 6:41:26 PM

Last updated: 8/8/2025, 5:46:57 AM

Views: 18

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats