CVE-2025-40259
Description
In the Linux kernel, the following vulnerability has been resolved:
scsi: sg: Do not sleep in atomic context
sg_finish_rem_req() calls blk_rq_unmap_user(). The latter function may sleep. Hence, call sg_finish_rem_req() with interrupts enabled instead of disabled.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In the Linux kernel's SCSI sg driver, sg_finish_rem_req() could sleep while holding interrupts disabled, leading to a potential deadlock or BUG.
Vulnerability
In the Linux kernel's SCSI generic (sg) driver, the function sg_finish_rem_req() calls blk_rq_unmap_user() calls blk_rq_unmap_user(), which may sleep. However, the caller was invoking this function with interrupts disabled, violating the rule that sleeping functions must not be called in atomic context. This could lead to a kernel BUG or deadlock.
Exploitation
An attacker with local access and the ability to issue SCSI generic ioctl commands could trigger this code path. The vulnerability is reachable through normal use of the sg driver, which is commonly used for sending SCSI commands from userspace. No special privileges beyond access to the sg device are required.
Impact
If triggered, the kernel would enter an invalid state, likely resulting in a system crash (kernel BUG) or a deadlock, causing a denial of service (DoS). There is no indication of memory corruption or privilege escalation.
Mitigation
The fix, committed to the Linux kernel stable tree, moves the call to sg_finish_rem_req() to a context where interrupts are enabled, ensuring that the potentially sleeping function is not called in atomic context [1][2][3]. Users should apply the latest stable kernel updates to address this issue.
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
811eeee00c94ddb6ac8703ab2109afbd88ecc3dfd520c3b4fb343cee5df7eb2c0340cfa256983d8375c0490449f2d1e1fVulnerability 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/109afbd88ecc46b6cc7551367222387e97999765nvd
- git.kernel.org/stable/c/11eeee00c94d770d4e45364060b5f1526dfe567bnvd
- git.kernel.org/stable/c/3dfd520c3b4ffe69e0630c580717d40447ab842fnvd
- git.kernel.org/stable/c/6983d8375c040bb449d2187f4a57a20de01244fenvd
- git.kernel.org/stable/c/90449f2d1e1f020835cba5417234636937dd657envd
- git.kernel.org/stable/c/b2c0340cfa25c5c1f65e8590cc1a2dc97d14ef0fnvd
- git.kernel.org/stable/c/b343cee5df7e750d9033fba33e96fc4399fa88a5nvd
- git.kernel.org/stable/c/db6ac8703ab2b473e1ec845f57f6dd961a388d9fnvd
News mentions
0No linked articles in our index yet.