Skip to main content

CVE-2024-40976: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-40976cvecve-2024-40976
Published: Fri Jul 12 2024 (07/12/2024, 12:32:12 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: drm/lima: mask irqs in timeout path before hard reset There is a race condition in which a rendering job might take just long enough to trigger the drm sched job timeout handler but also still complete before the hard reset is done by the timeout handler. This runs into race conditions not expected by the timeout handler. In some very specific cases it currently may result in a refcount imbalance on lima_pm_idle, with a stack dump such as: [10136.669170] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/lima/lima_devfreq.c:205 lima_devfreq_record_idle+0xa0/0xb0 ... [10136.669459] pc : lima_devfreq_record_idle+0xa0/0xb0 ... [10136.669628] Call trace: [10136.669634] lima_devfreq_record_idle+0xa0/0xb0 [10136.669646] lima_sched_pipe_task_done+0x5c/0xb0 [10136.669656] lima_gp_irq_handler+0xa8/0x120 [10136.669666] __handle_irq_event_percpu+0x48/0x160 [10136.669679] handle_irq_event+0x4c/0xc0 We can prevent that race condition entirely by masking the irqs at the beginning of the timeout handler, at which point we give up on waiting for that job entirely. The irqs will be enabled again at the next hard reset which is already done as a recovery by the timeout handler.

AI-Powered Analysis

AILast updated: 06/29/2025, 02:56:59 UTC

Technical Analysis

CVE-2024-40976 is a vulnerability identified in the Linux kernel specifically within the Direct Rendering Manager (DRM) subsystem for the Lima GPU driver. The issue arises from a race condition in the handling of rendering jobs and the DRM scheduler's job timeout mechanism. When a rendering job takes just long enough to trigger the DRM scheduler's timeout handler but still completes before the hard reset initiated by the timeout handler, an unexpected race condition occurs. This can lead to a reference count imbalance on the lima_pm_idle function, which manages power management idle states for the Lima GPU. The imbalance manifests as kernel warnings and stack dumps, indicating improper handling of interrupts (IRQs) during the timeout recovery process. The root cause is that the timeout handler does not mask IRQs at the start, allowing concurrent interrupt handling that conflicts with the reset process. The fix involves masking IRQs at the beginning of the timeout handler to prevent the race condition, effectively abandoning the rendering job and relying on the hard reset to recover the GPU state. IRQs are re-enabled after the reset, ensuring system stability. This vulnerability is specific to the Lima DRM driver, which supports ARM Mali GPUs, commonly found in embedded and mobile devices running Linux. The vulnerability does not appear to have known exploits in the wild and affects specific Linux kernel versions identified by commit hashes. No CVSS score has been assigned yet, and the vulnerability was published on July 12, 2024.

Potential Impact

For European organizations, the impact of CVE-2024-40976 depends largely on the deployment of Linux systems using the Lima DRM driver, typically in embedded devices, IoT, or ARM-based platforms. If exploited or triggered, the race condition can cause kernel warnings, potential system instability, or GPU resets, which may lead to temporary denial of service on affected devices. This could disrupt critical embedded systems or industrial control devices relying on ARM Mali GPUs. While the vulnerability does not directly lead to privilege escalation or remote code execution, the instability and GPU resets could impact availability and reliability of services, particularly in sectors like manufacturing, telecommunications, or automotive industries where embedded Linux devices are prevalent. The absence of known exploits reduces immediate risk, but unpatched systems remain vulnerable to potential future exploitation or accidental triggering of the race condition under heavy GPU load. Confidentiality and integrity impacts are minimal as the issue is related to device driver race conditions and resource management rather than data leakage or corruption.

Mitigation Recommendations

European organizations should prioritize updating Linux kernel versions to include the patch that masks IRQs at the start of the DRM scheduler timeout handler for the Lima driver. Since the vulnerability arises from a race condition in the kernel driver, applying the official Linux kernel updates or backported patches from trusted Linux distribution vendors is the most effective mitigation. For embedded or IoT devices where kernel updates may be slower, organizations should consider implementing monitoring for kernel warnings related to lima_devfreq_record_idle and lima_sched_pipe_task_done to detect potential triggering of the race condition. Additionally, workload management to avoid prolonged GPU rendering jobs that approach the timeout threshold can reduce the likelihood of triggering the vulnerability. Device manufacturers and integrators should validate firmware and kernel versions in their supply chain to ensure patched kernels are deployed. Finally, organizations should maintain robust incident response plans for embedded device failures and consider network segmentation to limit the impact of any device instability caused by this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-07-12T12:17:45.603Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9827c4522896dcbe1545

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

Last enriched: 6/29/2025, 2:56:59 AM

Last updated: 8/18/2025, 11:34:57 PM

Views: 16

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