ZeroHour

CVE-2026-89641

mass

Use-After-Free in Linux Kernel CIFS Client in cifs_file_set_size()

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

The Linux kernel's CIFS/SMB client contains a use-after-free in cifs_file_set_size(): when a handle-based set_file_size() RPC fails, the code releases the writable file handle with cifsFileInfo_put() but then falls through to a path-based fallback that reuses the borrowed tcon pointer. If that put dropped the last reference on a tlink already removed from the tlink tree (as happens during SMB reconnection or session teardown), the tcon has been freed and set_path_size() operates on freed memory. A local unprivileged attacker on a system with mounted CIFS/SMB shares can trigger the flaw by changing a file's size (e.g., truncate/ftruncate) while the session is being torn down, potentially crashing the kernel and, per the CVSS 3.1 score of 7.8, achieving confidentiality, integrity, and availability impact through kernel memory corruption. The fix sets tcon = NULL after cifsFileInfo_put() so the fallback re-acquires a fresh reference via cifs_sb_tlink() or fails cleanly; no specific affected version range was given in the advisory. No public proof of concept exists and the issue is not known to be exploited in the wild.

What to do: Apply your distribution's kernel update as soon as it includes the fix that sets tcon = NULL after cifsFileInfo_put() in cifs_file_set_size(). Until patched, restrict local untrusted accounts on machines with mounted CIFS/SMB shares, and unload or blacklist the cifs module on hosts that do not need SMB mounts. Watch kernel logs for oopses or BUG reports in cifs_file_set_size/set_path_size as a sign of exploitation attempts.

Affected
Linux kernel (CIFS/SMB client, cifs_file_set_size code path)
Estimated exposure
massPlausibly millions of Linux systems (any host running a kernel with the vulnerable CIFS code path and CIFS/SBS mounts in use) — The CIFS client is a standard in-tree Linux kernel module shipped by every major distribution, and SMB mounts are widely deployed on enterprise Linux servers, desktops, and appliances, so the vulnerable code ships in a very large installed…

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: cifs: clear tcon after cifsFileInfo_put() in cifs_file_set_size() When the else branch of cifs_file_set_size() finds a writable file handle via find_writable_file(), it borrows tcon and server from the handle's tlink, attempts the handle-based set_file_size() RPC, and then releases the handle with cifsFileInfo_put(). If set_file_size() fails, execution falls through to the path-based fallback, which reuses the borrowed tcon and server under the "if (tcon == NULL)" guard. Since tcon is not NULL at that point, the guard is skipped. If cifsFileInfo_put() dropped the last reference on a tlink that was already removed from the tlink tree (TCON_LINK_IN_TREE cleared, as happens during reconnection or session teardown), cifs_put_tlink() will have freed tcon; the subsequent set_path_size() call is then a use-after-free. Setting tcon = NULL after cifsFileInfo_put() causes the existing guard to take the cifs_sb_tlink() path, which acquires a fresh reference for the path-based operation or fails cleanly if the session is gone.

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

In the news

No ingested article mentions this CVE yet.