Junglewise Threat Intelligence

CVE-2026-64397: Linux Kernel ksmbd stack use-after-free in smb2_query_dir

CVE-2026-64397 · Severity: info · CVSS 7.5 · Published 2026-07-25

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability has been identified in the Linux kernel's ksmbd component, which provides SMB file sharing services. This flaw allows a remote attacker to potentially crash the system or cause unpredictable behavior by sending specific, simultaneous requests to view directory contents. The issue has been resolved in recent kernel updates by ensuring these requests are processed one at a time.

Technical details

A stack use-after-free vulnerability exists in the ksmbd component of the Linux kernel within the smb2_query_dir() function. The function stores a pointer to stack-allocated private data in the ksmbd_file readdir_data structure; however, concurrent QUERY_DIRECTORY requests using the same file handle can overwrite this pointer while an iterate_dir() callback is still active. This race condition allows a subsequent request to replace the private data before the initial request completes. The fix introduces a per-file mutex (readdir_lock) to serialize directory enumeration state access, covering scan restarts, entry state, and response construction. Patches are available in various stable kernel branches including 6.1.178, 6.6.145, 6.12.96, 6.18.39, and 7.1.4.

Affected products

  • Linux Linux Kernel 6.1.178, 6.6.145, 6.12.96, 6.18.39, 7.1.4

Timeline

  • 2026-06-12: other: Vulnerability fix authored
  • 2026-07-24: patched: Fix committed to stable kernel tree
  • 2026-07-25: disclosed: CVE published

References

Related threats