CVE-2025-40001
scsi: mvsas: Fix use-after-free bugs in mvs_work_queue
Description
In the Linux kernel, the following vulnerability has been resolved: scsi: mvsas: Fix use-after-free bugs in mvs_work_queue During the detaching of Marvell's SAS/SATA controller, the original code calls cancel_delayed_work() in mvs_free() to cancel the delayed work item mwq->work_q. However, if mwq->work_q is already running, the cancel_delayed_work() may fail to cancel it. This can lead to use-after-free scenarios where mvs_free() frees the mvs_info while mvs_work_queue() is still executing and attempts to access the already-freed mvs_info. A typical race condition is illustrated below: CPU 0 (remove) | CPU 1 (delayed work callback) mvs_pci_remove() | mvs_free() | mvs_work_queue() cancel_delayed_work() | kfree(mvi) | | mvi-> // UAF Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the delayed work item is properly canceled and any executing delayed work item completes before the mvs_info is deallocated. This bug was found by static analysis.
INFO
Published Date :
Oct. 18, 2025, 8:15 a.m.
Last Modified :
Oct. 29, 2025, 2:15 p.m.
Remotely Exploit :
No
Source :
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Solution
- Replace cancel_delayed_work() with cancel_delayed_work_sync().
- Ensure delayed work items are properly canceled.
- Complete executing work items before deallocation.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2025-40001.
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2025-40001 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2025-40001
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2025-40001 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2025-40001 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 29, 2025
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/a6f68f219d4d4b92d7c781708d4afc4cc42961ec Added Reference https://git.kernel.org/stable/c/aacd1777d4a795c387a20b9ca776e2c1225d05d7 -
CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 19, 2025
Action Type Old Value New Value Added Reference https://git.kernel.org/stable/c/00d3af40b158ebf7c7db2b3bbb1598a54bf28127 Added Reference https://git.kernel.org/stable/c/3c90f583d679c81a5a607a6ae0051251b6dee35b Added Reference https://git.kernel.org/stable/c/6ba7e73cafd155a5d3abf560d315f0bab2b9d89f Added Reference https://git.kernel.org/stable/c/c2c35cb2a31844f84f21ab364b38b4309d756d42 Added Reference https://git.kernel.org/stable/c/feb946d2fc9dc754bf3d594d42cd228860ff8647 -
New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Oct. 18, 2025
Action Type Old Value New Value Added Description In the Linux kernel, the following vulnerability has been resolved: scsi: mvsas: Fix use-after-free bugs in mvs_work_queue During the detaching of Marvell's SAS/SATA controller, the original code calls cancel_delayed_work() in mvs_free() to cancel the delayed work item mwq->work_q. However, if mwq->work_q is already running, the cancel_delayed_work() may fail to cancel it. This can lead to use-after-free scenarios where mvs_free() frees the mvs_info while mvs_work_queue() is still executing and attempts to access the already-freed mvs_info. A typical race condition is illustrated below: CPU 0 (remove) | CPU 1 (delayed work callback) mvs_pci_remove() | mvs_free() | mvs_work_queue() cancel_delayed_work() | kfree(mvi) | | mvi-> // UAF Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the delayed work item is properly canceled and any executing delayed work item completes before the mvs_info is deallocated. This bug was found by static analysis. Added Reference https://git.kernel.org/stable/c/60cd16a3b7439ccb699d0bf533799eeb894fd217