ZeroHour

CVE-2026-80926

niche

Use-After-Free in Linux Kernel ksmbd SMB Server Oplock Break Path

CVSS 3.1
9.8 critical
EPSS
Published
()
Modified
AI analysis

The Linux kernel's in-kernel SMB server (ksmbd) contains a use-after-free in the SMB2 oplock-break notification path: smb2_oplock_break_noti() grabs a connection reference (a plain atomic_inc, no lock) that can race with durable-handle teardown, where session_fd_check() clears opinfo->conn and the final ksmbd_conn_put() frees the connection. A second authenticated client that triggers an oplock break while the connection owning the durable batch oplock is being torn down can cause the queued break work to dereference the freed connection via ksmbd_conn_write(). Successful exploitation of this kernel memory corruption can crash the host or escalate privileges in kernel context; the flaw is reachable by any authenticated SMB client holding a durable batch oplock, despite the CVSS vector claiming no privileges required. Only systems actually running ksmbd (the kernel SMB server, distinct from userspace Samba) are affected. No public proof-of-concept exists and the issue is not in the CISA KEV catalog, so exploitation in the wild is not currently observed.

What to do: Update to a kernel release containing the upstream ksmbd fix as soon as your distribution ships it. If ksmbd is not needed, stop the service and blacklist the ksmbd kernel module, or replace it with Samba; if it must run, restrict SMB port 445 to trusted networks and tightly control which accounts can hold durable oplocks. Watch for kernel oops/panic reports on SMB-bearing hosts as an indicator of attempted exploitation.

Affected
Linux kernel (ksmbd SMB server subsystem)Specific version ranges not stated in the advisory; affects kernels with ksmbd present and actively running (ksmbd has shipped in mainline since Linux 5.15) up
Estimated exposure
nichelikely low thousands of internet-exposed ksmbd endpoints at most (unknown precisely) — ksmbd is opt-in (the module and ksmbd.mountd must be manually enabled) and Samba overwhelmingly dominates Linux SMB deployments, so only a small fraction of hosts exposing TCP 445 run ksmbd, and public scans rarely distinguish the two.

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix use-after-free in oplock break notification smb2_oplock_break_noti() reads opinfo->conn without any lock and dereferences it after two allocations which may sleep. When the durable handle owning the oplock is disconnected, session_fd_check() clears opinfo->conn and drops its conn reference under ci->m_lock, and the last ksmbd_conn_put() frees the connection. A break triggered by another connection that races with the teardown can then resurrect the freed connection: ksmbd_conn_get() is a plain atomic_inc, and the queued break work later dereferences the stale conn via ksmbd_conn_write(), a use-after-free reachable by any authenticated client holding a durable batch oplock. Thread the caller's inode into the notification path instead of taking a new reference on it. Every caller of oplock_break() already holds a live ksmbd_file (or an explicit ksmbd_inode_lookup_lock() reference, in the parent lease break paths) on the inode that owns the break target's oplock list, so ci cannot be freed during the call, and its lock can be taken without dereferencing opinfo->o_fp, which a concurrent close may free. Select and pin the connection under ci->m_lock, the same lock session_fd_check() and ksmbd_reopen_durable_fd() use to update opinfo->conn, so a concurrent detach either loses the race to the clear or keeps the connection alive until the notification work releases it. Transfer the reference to the work item and release it on allocation failures.

Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.