# CVE-2025-40328: smb: client: fix potential UAF in smb2_close_cached_fid()

- Severity: High 8.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.49%, higher than 44% of CVEs (2026-12-02)
- Published: 2025-12-09T04:09:44.876Z
- Modified: 2026-10-30T13:18:16.147Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

smb: client: fix potential UAF in smb2_close_cached_fid()

find_or_create_cached_dir() could grab a new reference after kref_put()
had seen the refcount drop to zero but before cfid_list_lock is acquired
in smb2_close_cached_fid(), leading to use-after-free.

Switch to kref_put_lock() so cfid_release() is called with
cfid_list_lock held, closing that gap.

(As written by CVE List.)

## Affected

- Linux Linux: from ebe98f1447bbccf8228335c62d86af02a0ed23f7 before bb3355ce9dcaba1b4a766f98b2ad373cab6cd626; from ebe98f1447bbccf8228335c62d86af02a0ed23f7 before cb52d9c86d70298de0ab7c7953653898cbc0efd6; from ebe98f1447bbccf8228335c62d86af02a0ed23f7 before 065bd62412271a2d734810dd50336cae88c54427; from ebe98f1447bbccf8228335c62d86af02a0ed23f7 before bdb596ceb4b7c3f28786a33840263728217fbcf5; from ebe98f1447bbccf8228335c62d86af02a0ed23f7 before 734e99623c5b65bf2c03e35978a0b980ebc3c2f8; 6.1 (not affected: before 6.1; from 6.1.191 up to 6.1.*; from 6.6.117 up to 6.6.*; from 6.12.58 up to 6.12.*; from 6.17.8 up to 6.17.*; from 6.18 up to *)

## References

- <https://git.kernel.org/stable/c/bb3355ce9dcaba1b4a766f98b2ad373cab6cd626>
- <https://git.kernel.org/stable/c/cb52d9c86d70298de0ab7c7953653898cbc0efd6>
- <https://git.kernel.org/stable/c/065bd62412271a2d734810dd50336cae88c54427>
- <https://git.kernel.org/stable/c/bdb596ceb4b7c3f28786a33840263728217fbcf5>
- <https://git.kernel.org/stable/c/734e99623c5b65bf2c03e35978a0b980ebc3c2f8>

## Sources

- CVE List: [CVE-2025-40328](https://www.cve.org/CVERecord?id=CVE-2025-40328), CVE Terms of Use, modified 2026-10-30
- NVD: [CVE-2025-40328](https://nvd.nist.gov/vuln/detail/CVE-2025-40328), Public domain, modified 2026-10-30

---

Page: https://cve.day/CVE-2025-40328 · Whole record: https://cve.day/CVE-2025-40328.json · Rebuilt by cve.day 2026-11-25T22:59:08.472Z
