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: Kernel memory corruption leading to potential remote code execution (inferred)
Action: Immediate
AI Analysis

Impact

ksmbd, the SMB server component in the Linux kernel, incorrectly handles concurrent SMB2 QUERY_DIRECTORY requests that share the same file handle. During directory enumeration, a stack‑allocated private structure pointer is stored in a shared field; a second concurrent request can overwrite this pointer while the first request is still using it, causing a stack use‑after‑free. This flaw is a CWE‑416 Use‑After‑Free and can corrupt kernel memory; based on the description, an attacker might trigger a kernel crash or, in a suitable environment, execute code with kernel privileges.

Affected Systems

All Linux kernels that include the ksmbd module and have not incorporated the per‑file mutex patch are affected. The advisory does not list specific release numbers, so any kernel built with ksmbd prior to the patch is at risk. Distributions that ship an unpatched kernel, custom kernels that embed ksmbd without the fix, or environments exposing SMB shares via ksmbd are therefore impacted.

Risk and Exploitability

The CVSS score of 9.8 marks this as a high‑severity flaw; however, the EPSS score is below 1% and it has not yet been listed in the CISA KEV catalog, suggesting a low likelihood of widespread exploitation. The race condition requires an attacker who can send concurrent directory listing requests over SMB to the same file handle. While there is no published exploit, the kernel memory corruption could lead to a denial of service or, if an exploit is crafted, remote code execution, so the vulnerability warrants prompt mitigation.

Generated by OpenCVE AI on September 5, 2026 at 00:06 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update the system to a Linux kernel release that includes the per‑file mutex fix for ksmbd.
  • If using a custom kernel, apply the patch that protects the readdir_data pointer with a per‑file mutex and rebuild ksmbd.
  • If SMB file sharing is not required, disable or remove ksmbd from the system.

Generated by OpenCVE AI on September 5, 2026 at 00:06 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
Ubuntu USN Ubuntu USN USN-8726-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8727-1 Linux kernel (OEM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-1 Linux kernel (GCP) vulnerabilities
Ubuntu USN Ubuntu USN USN-8760-1 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8726-2 Linux kernel (Raspberry Pi) vulnerabilities
Ubuntu USN Ubuntu USN USN-8781-1 Linux kernel (NVIDIA Tegra) vulnerabilities
Ubuntu USN Ubuntu USN USN-8726-3 Linux kernel (IBM) vulnerabilities
Ubuntu USN Ubuntu USN USN-8800-1 Linux kernel (NVIDIA BaseOS) vulnerabilities
Ubuntu USN Ubuntu USN USN-8760-2 Linux kernel (NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-8726-4 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-8728-2 Linux kernel (Azure) vulnerabilities
History

Fri, 04 Sep 2026 15:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

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-17T04:54:51.854Z

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

Link: CVE-2026-64397

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Analyzed

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

Modified: 2026-09-04T14:47:10.993

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-09-05T00:15:14Z

Weaknesses