# CVE-2025-39945: cnic: Fix use-after-free bugs in cnic\_delete\_task

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.24% (percentile 9, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-10-04T07:31:07.109Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= fdf24086f4752aee5dfb40143c736250df017820, \< fde6e73189f40ebcf0633aed2b68e731c25f3aa3; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 7b6a5b0a6b392263c3767fc945b311ea04b34bbd; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 0405055930264ea8fd26f4131466fa7652e5e47d; \>= fdf24086f4752aee5dfb40143c736250df017820, \< e1fcd4a9c09feac0902a65615e866dbf22616125; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 8eeb2091e72d75df8ceaa2172638d61b4cf8929a; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 6e33a7eed587062ca8161ad1f4584882a860d697; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 0627e1481676669cae2df0d85b5ff13e7d24c390; \>= fdf24086f4752aee5dfb40143c736250df017820, \< cfa7d9b1e3a8604afc84e9e51d789c29574fb216
- Anyone running Linux 2.6.37

## 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.

## Affected and fixed versions

- Linux: \>= fdf24086f4752aee5dfb40143c736250df017820, \< fde6e73189f40ebcf0633aed2b68e731c25f3aa3; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 7b6a5b0a6b392263c3767fc945b311ea04b34bbd; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 0405055930264ea8fd26f4131466fa7652e5e47d; \>= fdf24086f4752aee5dfb40143c736250df017820, \< e1fcd4a9c09feac0902a65615e866dbf22616125; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 8eeb2091e72d75df8ceaa2172638d61b4cf8929a; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 6e33a7eed587062ca8161ad1f4584882a860d697; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 0627e1481676669cae2df0d85b5ff13e7d24c390; \>= fdf24086f4752aee5dfb40143c736250df017820, \< cfa7d9b1e3a8604afc84e9e51d789c29574fb216 (cvelist)
- Linux: 2.6.37 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-39945. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-39945.md
Affected: Linux >= fdf24086f4752aee5dfb40143c736250df017820, < fde6e73189f40ebcf0633aed2b68e731c25f3aa3; >= fdf24086f4752aee5dfb40143c736250df017820, < 7b6a5b0a6b392263c3767fc945b311ea04b34bbd; >= fdf24086f4752aee5dfb40143c736250df017820, < 0405055930264ea8fd26f4131466fa7652e5e47d; >= fdf24086f4752aee5dfb401…
Fixed in: Linux 7b6a5b0a6b392263c3767fc945b311ea04b34bbd, Linux 0405055930264ea8fd26f4131466fa7652e5e47d, Linux 8eeb2091e72d75df8ceaa2172638d61b4cf8929a, Linux 6e33a7eed587062ca8161ad1f4584882a860d697, Linux 0627e1481676669cae2df0d85b5ff13e7d24c390

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-39945 being exploited?

There is no confirmed exploitation: CVE-2025-39945 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.24% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-39945?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-39945?

Linux \>= fdf24086f4752aee5dfb40143c736250df017820, \< fde6e73189f40ebcf0633aed2b68e731c25f3aa3; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 7b6a5b0a6b392263c3767fc945b311ea04b34bbd; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 0405055930264ea8fd26f4131466fa7652e5e47d; \>= fdf24086f4752aee5dfb40143c736250df017820, \< e1fcd4a9c09feac0902a65615e866dbf22616125; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 8eeb2091e72d75df8ceaa2172638d61b4cf8929a; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 6e33a7eed587062ca8161ad1f4584882a860d697; \>= fdf24086f4752aee5dfb40143c736250df017820, \< 0627e1481676669cae2df0d85b5ff13e7d24c390; \>= fdf24086f4752aee5dfb40143c736250df017820, \< cfa7d9b1e3a8604afc84e9e51d789c29574fb216; Linux 2.6.37.

### Is there a fix for CVE-2025-39945?

Yes. Fixed in Linux 7b6a5b0a6b392263c3767fc945b311ea04b34bbd, Linux 0405055930264ea8fd26f4131466fa7652e5e47d, Linux 8eeb2091e72d75df8ceaa2172638d61b4cf8929a, Linux 6e33a7eed587062ca8161ad1f4584882a860d697, Linux 0627e1481676669cae2df0d85b5ff13e7d24c390. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-39945?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/fde6e73189f40ebcf0633aed2b68e731c25f3aa3>
- patch: <https://git.kernel.org/stable/c/7b6a5b0a6b392263c3767fc945b311ea04b34bbd>
- patch: <https://git.kernel.org/stable/c/0405055930264ea8fd26f4131466fa7652e5e47d>
- patch: <https://git.kernel.org/stable/c/e1fcd4a9c09feac0902a65615e866dbf22616125>
- patch: <https://git.kernel.org/stable/c/8eeb2091e72d75df8ceaa2172638d61b4cf8929a>
- patch: <https://git.kernel.org/stable/c/6e33a7eed587062ca8161ad1f4584882a860d697>
- patch: <https://git.kernel.org/stable/c/0627e1481676669cae2df0d85b5ff13e7d24c390>
- patch: <https://git.kernel.org/stable/c/cfa7d9b1e3a8604afc84e9e51d789c29574fb216>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-39945>

HTML: <https://flawdb.com/CVE-2025-39945> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-39945>
