Skip to main content
Vulnerability Database/CVE-2024-35864

CVE-2024-35864: Linux Kernel SMB Use-After-Free Flaw

CVE-2024-35864 is a use-after-free vulnerability in the Linux Kernel SMB client that occurs in smb2_is_valid_lease_break function. This article covers the technical details, affected versions, and patches.

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-2024-35864 Overview

CVE-2024-35864 is a use-after-free (UAF) vulnerability [CWE-416] in the Linux kernel's SMB client code. The flaw resides in smb2_is_valid_lease_break(), where the function iterates over active sessions without skipping sessions in the tear-down state (status == SES_EXITING). Processing a session that is being released can lead to access of freed memory. The upstream fix skips sessions marked SES_EXITING during lease break validation.

Critical Impact

A local, authenticated attacker able to trigger SMB lease break processing on a mounted CIFS share can cause memory corruption, kernel crash, or potential privilege escalation.

Affected Products

  • Linux Kernel (multiple stable branches prior to the fix commits)
  • Linux Kernel 6.9-rc1
  • Linux Kernel 6.9-rc2

Discovery Timeline

  • 2024-05-19 - CVE-2024-35864 published to NVD
  • 2026-08-04 - Last updated in NVD database

Technical Details for CVE-2024-35864

Vulnerability Analysis

The vulnerability lives in the Linux kernel's SMB client (fs/smb/client) lease-break handling path. When the server sends a lease break notification, smb2_is_valid_lease_break() walks the list of SMB sessions to locate the matching tcon and open file. The function previously did not check whether a session was in the process of being destroyed. A session with status == SES_EXITING can have its backing structures freed concurrently, so dereferencing session fields during the walk leads to a use-after-free.

An attacker with local access and the ability to mount or interact with a CIFS share can race session teardown against incoming lease break processing. Successful exploitation of a kernel UAF can produce memory corruption, denial of service through a kernel oops, or escalation to kernel-mode code execution depending on allocator state and heap grooming.

Root Cause

The root cause is missing state validation during list iteration. The lease break handler did not treat SES_EXITING sessions as unsafe to touch, allowing concurrent teardown to free structures while they were still in use by the lease break code path. The upstream commits add an explicit skip for sessions in the exiting state.

Attack Vector

The CVSS vector indicates a local attack vector requiring low privileges and no user interaction. Triggering the bug requires the ability to drive SMB client activity, typically mounting a CIFS share or inducing lease break traffic on an existing mount. See the referenced Linux kernel stable commits for the authoritative patch content.

// No verified public exploit code is available for CVE-2024-35864.
// Refer to the upstream commits for the exact source-level changes.

Detection Methods for CVE-2024-35864

Indicators of Compromise

  • Kernel oops or panic messages referencing smb2_is_valid_lease_break, cifs, or smb modules in dmesg or /var/log/kern.log.
  • KASAN reports indicating use-after-free in the SMB/CIFS client subsystem.
  • Unexpected CIFS mount disconnects or hangs correlated with session teardown events.

Detection Strategies

  • Inventory running kernel versions across Linux hosts and compare against the fixed stable commits (705c76f, a8344e2, c868cab, f92739f).
  • Monitor hosts that mount SMB/CIFS shares, as only systems using the kernel SMB client are exposed.
  • Enable KASAN on test or canary systems to surface UAF conditions during QA of SMB workloads.

Monitoring Recommendations

  • Forward kernel ring buffer logs to a central log platform and alert on BUG:, KASAN, or general protection fault entries referencing CIFS code paths.
  • Track CIFS mount/unmount events and session state transitions on production servers.
  • Alert on repeated unexpected process terminations or kernel restarts on hosts with active SMB mounts.

How to Mitigate CVE-2024-35864

Immediate Actions Required

  • Update the Linux kernel to a version that includes one of the fix commits referenced by upstream stable (705c76f, a8344e2, c868cab, f92739f).
  • Apply distribution-provided kernel updates from your Linux vendor and reboot affected hosts.
  • Restrict local shell access on systems that mount untrusted SMB shares to limit the pool of users who can trigger the race.

Patch Information

The fix skips sessions with status == SES_EXITING inside smb2_is_valid_lease_break(), preventing access to session structures that are being torn down. Patches are available in the upstream Linux stable tree. See the Kernel Git commit a8344e2 and related stable backports for the authoritative source changes. Consume these via your distribution's kernel package channel.

Workarounds

  • Unmount CIFS shares and disable the cifs kernel module on systems where SMB client functionality is not required (modprobe -r cifs).
  • Blacklist the cifs module in /etc/modprobe.d/ on hosts that have no business accessing SMB shares.
  • Restrict local account creation and enforce least-privilege policies to reduce the number of users who can trigger CIFS activity.
bash
# Verify the running kernel version and whether the cifs module is loaded
uname -r
lsmod | grep -i cifs

# Prevent the cifs module from loading on systems that do not need SMB client support
echo "blacklist cifs" | sudo tee /etc/modprobe.d/disable-cifs.conf
sudo update-initramfs -u

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.