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

CVE-2026-98172: Linux Kernel RDMA Use-After-Free Vulnerability

CVE-2026-98172 is a use-after-free flaw in the Linux kernel affecting RDMA connection handling in SMB client code. The vulnerability causes resource leaks during connection failures. This article covers technical details, system impact, 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-2026-98172 Overview

CVE-2026-98172 is a memory leak vulnerability in the Linux kernel's SMB (Server Message Block) client code. The flaw resides in the error handling path when establishing an RDMA (Remote Direct Memory Access) connection for SMB Direct. When smbd_get_connection() successfully establishes an RDMA connection but a subsequent call to cifs_get_tcp_session() fails, the error cleanup path frees the tcp_ses structure without first destroying the associated smbd_connection. This leaves the smbd_connection orphaned, leaking kernel memory and associated RDMA resources on each failed connection attempt.

Critical Impact

Repeated failures during SMB Direct session setup cause progressive kernel memory and RDMA resource exhaustion, potentially leading to denial of service on affected hosts.

Affected Products

  • Linux kernel SMB client (cifs.ko) with SMB Direct (RDMA) support enabled
  • Stable kernel branches referenced by commits 3164402c, 5c908e49, 928edc4b, b26a3fcf, e3344bb0, and e75c9615
  • Systems mounting SMB shares over RDMA transports (RoCE, iWARP, InfiniBand)

Discovery Timeline

  • 2026-10-06 - CVE-2026-98172 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98172

Vulnerability Analysis

The flaw is a resource leak in the cifs client's SMB Direct connection setup logic. During session establishment, the client first calls smbd_get_connection() to negotiate the RDMA transport. If that succeeds, it then calls cifs_get_tcp_session() to complete session construction, which internally performs operations such as kthread_create().

When cifs_get_tcp_session() fails after a successful RDMA setup, the out_err cleanup path invokes kfree(tcp_ses) directly. It does not call smbd_destroy() first, so the smbd_connection object, its queue pairs, memory registrations, and completion queues remain allocated with no reference from freed tcp_ses.

The fix calls smbd_destroy() in the out_err path before kfree(tcp_ses). smbd_destroy() safely handles a NULL smbd_conn, so unconditional invocation is correct.

Root Cause

The root cause is incomplete cleanup ordering in an error path. The code assumed smbd_connection lifetime was tied to a fully constructed TCP session structure. When session construction aborted mid-flight, the RDMA resources had no owner responsible for their teardown, producing a classic kernel memory leak.

Attack Vector

Exploitation requires conditions that cause cifs_get_tcp_session() to fail after RDMA negotiation succeeds, such as kernel thread creation failures or transient resource pressure. A local administrator or automated workload performing repeated mounts of an SMB share over RDMA can trigger the leak, slowly exhausting kernel memory and RDMA hardware resources. The vulnerability does not provide code execution or privilege escalation.

No exploitation code is published. See the referenced Kernel Git Commit 3164402c for the authoritative patch diff.

Detection Methods for CVE-2026-98172

Indicators of Compromise

  • Growth in kernel slab allocations attributable to cifs and smbd objects over time
  • Repeated cifs_get_tcp_session() failure messages in dmesg paired with successful RDMA negotiation events
  • Progressive reduction in available RDMA queue pairs or protection domains reported by the HCA driver

Detection Strategies

  • Audit mounted kernel versions against the fixed commits listed in the kernel.org references
  • Correlate SMB mount failure events with host memory and RDMA resource telemetry to spot leak patterns
  • Run slabtop and /proc/slabinfo baselines on SMB client hosts to detect anomalous growth in cifs-related caches

Monitoring Recommendations

  • Alert on sustained increases in kernel Slab and SUnreclaim memory on hosts that mount SMB over RDMA
  • Track mount(8) exit codes for cifs filesystems and flag hosts with elevated failure rates
  • Monitor RDMA subsystem counters via rdma resource show for unbounded growth

How to Mitigate CVE-2026-98172

Immediate Actions Required

  • Apply the stable kernel update containing the fix commits referenced on kernel.org
  • Reboot SMB client hosts after patching to clear any leaked RDMA state accumulated prior to the update
  • Inventory hosts that mount SMB shares with the rdma transport option and prioritize them for patching

Patch Information

The fix adds a call to smbd_destroy() in the out_err cleanup path of the SMB client session setup prior to kfree(tcp_ses). Authoritative patches are available in the following upstream commits: 3164402c, 5c908e49, 928edc4b, b26a3fcf, e3344bb0, and e75c9615. Consume the fix through your distribution's stable kernel update channel.

Workarounds

  • Avoid mounting SMB shares with the rdma transport option until the kernel is patched; fall back to standard TCP transport
  • Restrict and monitor automated mount retry logic to prevent amplifying the leak when SMB Direct setup fails
  • Where RDMA is required, cap concurrent mount attempts and schedule host restarts to reclaim leaked kernel memory
bash
# Verify running kernel and SMB mount transport
uname -r
mount -t cifs | grep -i rdma

# Temporary workaround: mount SMB share over TCP instead of RDMA
mount -t cifs //server/share /mnt/share \
    -o username=user,vers=3.1.1

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.