Skip to main content
Vulnerability Database/CVE-2026-93812

CVE-2026-93812: Linux Kernel ksmbd Memory Leak Vulnerability

CVE-2026-93812 is a memory leak flaw in the Linux kernel ksmbd component that occurs when ndr_encode_v4_ntacl fails to free allocated memory. This post explains its technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-93812 Overview

CVE-2026-93812 is a memory leak vulnerability in the Linux kernel's ksmbd in-kernel SMB server. The flaw resides in ksmbd_vfs_set_sd_xattr, where ndr_encode_v4_ntacl() allocates a buffer via kzalloc() at function entry. If any subsequent ndr_write_*() call fails during encoding, the allocated sd_ndr.data buffer is not released, resulting in a kernel memory leak on each error path.

The upstream fix relocates kfree(sd_ndr.data) to the out label, ensuring the buffer is released on both success and error return paths.

Critical Impact

Repeated triggering of the error path by an authenticated SMB client can exhaust kernel memory, degrading system stability.

Affected Products

  • Linux kernel builds that enable ksmbd (CONFIG_SMB_SERVER)
  • Distributions shipping kernels prior to the fix commits 9b4dec7, c521dd7, and d4d56b0
  • Systems exposing an SMB share through the in-kernel ksmbd server

Discovery Timeline

  • 2026-09-24 - CVE-2026-93812 published to NVD
  • 2026-09-25 - Last updated in NVD database

Technical Details for CVE-2026-93812

Vulnerability Analysis

The vulnerability is a kernel-space memory leak [CWE-401] in the ksmbd SMB server component. The function ndr_encode_v4_ntacl() is invoked while serializing an NTFS-style security descriptor into NDR (Network Data Representation) format for storage as an extended attribute.

At function entry, sd_ndr.data is allocated with kzalloc(). The function then issues a series of ndr_write_*() calls to serialize fields of the security descriptor. Each call can return an error. In the pre-patch code, these error returns exited the function directly without releasing the previously allocated buffer.

Because ksmbd_vfs_set_sd_xattr is reachable whenever an SMB client issues an operation that updates a file's security descriptor, each failed encode operation consumes non-reclaimable kernel memory. Sustained triggering causes measurable kernel memory pressure.

Root Cause

The root cause is improper cleanup along error return paths in ndr_encode_v4_ntacl(). The allocation lacked a single consolidated exit label, so each ndr_write_*() error branch bypassed the kfree() call. The fix introduces an out: label that frees sd_ndr.data for both success and failure flows.

Attack Vector

Exploitation requires an authenticated SMB session with permission to modify security descriptors on a share served by ksmbd. An attacker able to repeatedly cause ndr_write_*() failures, for example by submitting crafted ACL updates, can leak kernel memory per operation. The impact is limited to availability through resource exhaustion; no code execution or information disclosure is indicated in the upstream patch description.

See the upstream fixes: Kernel Git Commit 9b4dec7, Kernel Git Commit c521dd7, and Kernel Git Commit d4d56b0.

Detection Methods for CVE-2026-93812

Indicators of Compromise

  • Steadily increasing kernel Slab or SUnreclaim values in /proc/meminfo on hosts running ksmbd
  • Repeated SMB client operations attempting to set security descriptors that return protocol-level errors
  • Growth in kmalloc-* slab caches correlated with SMB activity, observable through slabtop

Detection Strategies

  • Enable kmemleak on test kernels to confirm allocations originating in ndr_encode_v4_ntacl are not freed
  • Correlate ksmbd audit logs with kernel memory telemetry to identify abusive clients
  • Monitor the running kernel version against the fixed commits to identify unpatched hosts in inventory

Monitoring Recommendations

  • Baseline normal ksmbd memory consumption and alert on sustained upward drift
  • Track SMB authentication events and ACL modification frequency per client
  • Forward dmesg output containing ksmbd messages to a central log platform for retention and correlation

How to Mitigate CVE-2026-93812

Immediate Actions Required

  • Identify Linux hosts that load the ksmbd module and determine whether they serve production SMB shares
  • Apply vendor kernel updates that include commits 9b4dec7, c521dd7, or d4d56b0 as soon as they are available
  • Restrict SMB share access to trusted authenticated users while patching is pending

Patch Information

The fix moves kfree(sd_ndr.data) into an out: label inside ndr_encode_v4_ntacl() so the allocation is released on every return path. Patched trees are available in the stable kernel commits referenced above. Rebuild or install distribution kernels that incorporate these commits.

Workarounds

  • Unload the ksmbd module (modprobe -r ksmbd) on hosts that do not require an SMB server
  • Switch SMB serving to a userspace implementation such as Samba until the kernel is patched
  • Limit which accounts can modify file security descriptors on ksmbd-exported shares
bash
# Verify whether ksmbd is loaded and disable it where not required
lsmod | grep ksmbd
systemctl stop ksmbd.service 2>/dev/null
modprobe -r ksmbd
echo 'blacklist ksmbd' | sudo tee /etc/modprobe.d/disable-ksmbd.conf

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.