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.
Published: 2026-07-25
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The ksmbd component of the Linux kernel mismanages concurrent SMB2 QUERY_DIRECTORY requests that share the same file handle. While processing a directory read, a pointer to a stack‑allocated private structure is stored in a shared field. If a second request arrives and overwrites this pointer before the first request finishes, the kernel accesses freed stack memory, causing a stack use‑after‑free race condition. A successful exploit could corrupt kernel memory, leading to denial of service or, in configurations where attacker control can be achieved, arbitrary code execution.

Affected Systems

All Linux kernel installations that ship ksmbd without the recent per‑file mutex fix are affected. Because the advisory does not list specific releases, any distribution that has not applied the latest kernel update containing the patch, as well as custom kernel builds that incorporate an unpatched ksmbd, remain at risk. The vulnerability is relevant to systems running SMB shares via ksmbd.

Risk and Exploitability

The EPSS score is less than 1 % and the vulnerability is not listed in CISA KEV, which together suggest a low probability of public exploitation at present. Based on the description, it is inferred that an attacker who can gain SMB access and orchestrate concurrent QUERY_DIRECTORY requests on the same file handle could trigger the race condition and potentially cause a kernel crash or write to memory. This inference follows from the race description but is not confirmed by an existing exploit. Additionally, it is inferred that a highly skilled adversary might attempt to time overlapping requests to manipulate the shared pointer, although such an attack remains speculative.

Generated by OpenCVE AI on August 3, 2026 at 18:52 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update the Linux kernel to the latest release that contains the ksmbd per‑file mutex fix
  • Rebuild any custom kernels to include the patched ksmbd code before deployment
  • Restart the affected services or reboot the system to load the updated kernel

Generated by OpenCVE AI on August 3, 2026 at 18:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4720-1 linux security update
Debian DLA Debian DLA DLA-4723-1 linux-6.1 security update
Debian DLA Debian DLA DLA-4724-1 linux-6.12 new package
History

Tue, 28 Jul 2026 00:15:00 +0000


Mon, 27 Jul 2026 05:15:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Sat, 25 Jul 2026 09:30:00 +0000

Type Values Removed Values Added
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.
Title ksmbd: serialize QUERY_DIRECTORY requests per file
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-08-05T12:41:35.141Z

Reserved: 2026-07-19T15:36:31.785Z

Link: CVE-2026-64397

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-07-25T10:17:23.160

Modified: 2026-08-11T15:01:50.637

Link: CVE-2026-64397

cve-icon Redhat

Severity :

Publid Date: 2026-07-25T00:00:00Z

Links: CVE-2026-64397 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T19:00:05Z

Weaknesses
  • CWE-562

    Return of Stack Variable Address