CVE-2025-40197
Description
In the Linux kernel, the following vulnerability has been resolved:
media: mc: Clear minor number before put device
The device minor should not be cleared after the device is released.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel's media controller subsystem, a use-after-free bug occurs when the device minor number is cleared after the device is released.
Vulnerability
Analysis
In the Linux kernel's media controller (mc) subsystem, a use-after-free vulnerability exists in the device cleanup path. The issue is that the device minor number is cleared after the device is released [1]. This violates the proper sequence where the minor number should be cleared before the device is put (released).
Exploitation
An attacker with local access and the ability to trigger device unregistration in the media controller subsystem can exploit this race condition. No special authentication is required beyond standard user-level access to interact with media device nodes. The bug manifests when a media device is being removed and concurrently a user-space process still holds a reference to the device node.
Impact
If successfully exploited, this flaw can lead to a use-after-free condition, potentially allowing an attacker to crash the system or escalate privileges. The kernel's memory safety is compromised, as the freed device structure may be reused for other purposes.
Mitigation
Patches have been committed to the Linux kernel stable branches [2][3]. Users should update to the latest kernel version containing the fix. The patch ensures the minor number is cleared before the device is released, preventing the use-after-free scenario.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
8dd156f44ea8264dbc6f50ce95d327391f9fa8f52c7f38f0f7bd4e5367d097db47e737128ac01416d477c8cfc8cec1b4dVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/5d327391f9fafeb0938be4fc538dd0bd54a0b2efnvd
- git.kernel.org/stable/c/64dbc6f50ce92b7da203b1bcdd96a370bbc9b74dnvd
- git.kernel.org/stable/c/7bd4e5367d0940ccec4d7546bb6bd019ab2c71aanvd
- git.kernel.org/stable/c/7db47e737128b3585ae679b709b85f3f44cd8750nvd
- git.kernel.org/stable/c/8cfc8cec1b4da88a47c243a11f384baefd092a50nvd
- git.kernel.org/stable/c/8f52c7f38f0f2ee2afc331e6b873acba5e9490a8nvd
- git.kernel.org/stable/c/ac01416d477c2dc6016782635ae022f8cc634a29nvd
- git.kernel.org/stable/c/dd156f44ea82cc249f46c519eed3b2f8983c8002nvd
News mentions
0No linked articles in our index yet.