CVE-2025-39945
cnic: Fix use-after-free bugs in cnic_delete_task
Check your servers for CVE-2025-39945
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-39945 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
cnic: Fix use-after-free bugs in cnic_delete_task
The original code uses cancel_delayed_work() in cnic_cm_stop_bnx2x_hw(), which does not guarantee that the delayed work item 'delete_task' has fully completed if it was already running. Additionally, the delayed work item is cyclic, the flush_workqueue() in cnic_cm_stop_bnx2x_hw() only blocks and waits for work items that were already queued to the workqueue prior to its invocation. Any work items submitted after flush_workqueue() is called are not included in the set of tasks that the flush operation awaits. This means that after the cyclic work items have finished executing, a delayed work item may still exist in the workqueue. This leads to use-after-free scenarios where the cnic_dev is deallocated by cnic_free_dev(), while delete_task remains active and attempt to dereference cnic_dev in cnic_delete_task().
A typical race condition is illustrated below:
CPU 0 (cleanup) | CPU 1 (delayed work callback) cnic_netdev_event() | cnic_stop_hw() | cnic_delete_task() cnic_cm_stop_bnx2x_hw() | ... cancel_delayed_work() | /* the queue_delayed_work() flush_workqueue() | executes after flush_workqueue()*/ | queue_delayed_work() cnic_free_dev(dev)//free | cnic_delete_task() //new instance | dev = cp->dev; //use
Replace cancel_delayed_work() with cancel_delayed_work_sync() to ensure that the cyclic delayed work item is properly canceled and that any ongoing execution of the work item completes before the cnic_dev is deallocated. Furthermore, since cancel_delayed_work_sync() uses __flush_work(work, true) to synchronously wait for any currently executing instance of the work item to finish, the flush_workqueue() becomes redundant and should be removed.
This bug was identified through static analysis. To reproduce the issue and validate the fix, I simulated the cnic PCI device in QEMU and introduced intentional delays — such as inserting calls to ssleep() within the cnic_delete_task() function — to increase the likelihood of triggering the bug.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.16%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 5.50% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 10 Jun 2026):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- total: full control of the component or of its data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from fdf24086f4752aee5dfb40143c736250df017820, before fde6e73189f40ebcf0633aed2b68e731c25f3aa3 affected from fdf24086f4752aee5dfb40143c736250df017820, before 7b6a5b0a6b392263c3767fc945b311ea04b34bbd affected from fdf24086f4752aee5dfb40143c736250df017820, before 0405055930264ea8fd26f4131466fa7652e5e47d affected from fdf24086f4752aee5dfb40143c736250df017820, before e1fcd4a9c09feac0902a65615e866dbf22616125 affected from fdf24086f4752aee5dfb40143c736250df017820, before 8eeb2091e72d75df8ceaa2172638d61b4cf8929a affected from fdf24086f4752aee5dfb40143c736250df017820, before 6e33a7eed587062ca8161ad1f4584882a860d697 affected from fdf24086f4752aee5dfb40143c736250df017820, before 0627e1481676669cae2df0d85b5ff13e7d24c390 affected from fdf24086f4752aee5dfb40143c736250df017820, before cfa7d9b1e3a8604afc84e9e51d789c29574fb216
Other versions: unaffected
|
| Linux |
affected 2.6.37 unaffected before 2.6.37 unaffected from 5.4.300 up to and including 5.4.* unaffected from 5.10.245 up to and including 5.10.* unaffected from 5.15.194 up to and including 5.15.* unaffected from 6.1.154 up to and including 6.1.* unaffected from 6.6.108 up to and including 6.6.* unaffected from 6.12.49 up to and including 6.12.* unaffected from 6.16.9 up to and including 6.16.* unaffected 6.17 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-39945 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-39945
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-39945
trivy image --scanners vuln IMAGE | grep CVE-2025-39945
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/fde6e73189f40ebcf0633aed2b68e731c25f3aa3 git.kernel.org
- https://git.kernel.org/stable/c/7b6a5b0a6b392263c3767fc945b311ea04b34bbd git.kernel.org
- https://git.kernel.org/stable/c/0405055930264ea8fd26f4131466fa7652e5e47d git.kernel.org
- https://git.kernel.org/stable/c/e1fcd4a9c09feac0902a65615e866dbf22616125 git.kernel.org
- https://git.kernel.org/stable/c/8eeb2091e72d75df8ceaa2172638d61b4cf8929a git.kernel.org
- https://git.kernel.org/stable/c/6e33a7eed587062ca8161ad1f4584882a860d697 git.kernel.org
- https://git.kernel.org/stable/c/0627e1481676669cae2df0d85b5ff13e7d24c390 git.kernel.org
- https://git.kernel.org/stable/c/cfa7d9b1e3a8604afc84e9e51d789c29574fb216 git.kernel.org
Source: the record CVE-2025-39945 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse