# CVE-2026-64397: ksmbd: serialize QUERY_DIRECTORY requests per file

- Severity: Critical 9.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/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.48%, higher than 42% of CVEs (2026-12-01)
- Published: 2026-07-25T08:50:41.620Z
- Modified: 2026-09-04T14:47:10.993Z
- Weaknesses: CWE-416
- Assigned by: Linux

## Description

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

ksmbd: serialize QUERY_DIRECTORY requests per file

smb2_query_dir() stores a pointer to its stack-allocated private data in
the ksmbd_file readdir_data. Concurrent QUERY_DIRECTORY requests using the
same file handle can overwrite this pointer while an iterate_dir() callback
is still using it, resulting in a stack use-after-free.

Add a per-file mutex and hold it while accessing the shared directory
enumeration state. The lock covers scan restart, dot entry state,
readdir_data setup and iteration, and response construction. This prevents
another request from replacing readdir_data.private before the current
request has finished using it and also serializes the shared file position.

(As written by CVE List.)

## Affected

- Linux Linux: from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 1426fd79102539bc0ab5c8fced047ad4313b9908; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 2a64dbf9c739ddf7a25a066507597bf89f8f73d2; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before 64dac2d486ec1eb18dc00968b16a230b6b75ec24; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before a1d5d31cad593ea5e1b637f2f39c9ef6d09d1199; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before fd22b039a5a05bc1d6818e9dcd1001fb432a829d; from e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 before be6d26bf27499977c746abc163659915082348d8; 5.15 (not affected: before 5.15; from 6.1.178 up to 6.1.*; from 6.6.145 up to 6.6.*; from 6.12.96 up to 6.12.*; from 6.18.39 up to 6.18.*; from 7.1.4 up to 7.1.*; from 7.2 up to *)
- linux linux_kernel: from 5.15 before 6.1.178; from 6.2 before 6.6.145; from 6.7 before 6.12.96; from 6.13 before 6.18.39; from 6.19 before 7.1.4

## References

- <https://git.kernel.org/stable/c/1426fd79102539bc0ab5c8fced047ad4313b9908> (patch)
- <https://git.kernel.org/stable/c/2a64dbf9c739ddf7a25a066507597bf89f8f73d2> (patch)
- <https://git.kernel.org/stable/c/64dac2d486ec1eb18dc00968b16a230b6b75ec24> (patch)
- <https://git.kernel.org/stable/c/a1d5d31cad593ea5e1b637f2f39c9ef6d09d1199> (patch)
- <https://git.kernel.org/stable/c/fd22b039a5a05bc1d6818e9dcd1001fb432a829d> (patch)
- <https://git.kernel.org/stable/c/be6d26bf27499977c746abc163659915082348d8> (patch)

## Sources

- CVE List: [CVE-2026-64397](https://www.cve.org/CVERecord?id=CVE-2026-64397), CVE Terms of Use, modified 2026-08-17
- NVD: [CVE-2026-64397](https://nvd.nist.gov/vuln/detail/CVE-2026-64397), Public domain, modified 2026-09-04

---

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