ZeroHour

CVE-2026-89638

moderate

Setuid/setgid bits survive writes in Linux kernel CIFS/SMB client (cifsacl/POSIX mounts)

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

The Linux kernel SMB client (cifs.ko) fails to push the cleared file mode to the server when the VFS strips the setuid/setgid bits on write, but only on mounts where the mode is stored server-side: those using the cifsacl or modefromsid mount options, the SMB3.1.1 POSIX extensions, or the SMB1 Unix extensions. In both cifs_setattr_unix() and cifs_setattr_nounix(), the code unconditionally dropped ATTR_MODE when ATTR_KILL_SUID/ATTR_KILL_SGID was set, so the setuid/setgid bit persisted on the server even though it was cleared locally. A local attacker with write access to a file on such a mount can keep privileged bits alive on attacker-modified files, enabling privilege escalation on subsequent execution; CVSS 3.1 is 7.8 (high). Affected systems are Linux machines with CIFS mounts using those specific options or extensions — default mounts that only emulate the mode via the DOS read-only attribute are not affected. No public proof of concept is known and the flaw is not on the CISA KEV list.

What to do: Apply your distribution's kernel update containing this fix and remount affected shares. In the meantime, audit /proc/mounts for cifsacl or modefromsid options and for mounts that negotiated SMB3.1.1 POSIX or SMB1 Unix extensions, and consider dropping those options where feasible since default mounts are unaffected; also avoid storing or writing setuid/setgid binaries on CIFS mounts and scan existing shares for files that retain those bits.

Affected
Linux kernel (CIFS/SMB client, fs/smb/client, cifs.ko)
Estimated exposure
moderateunknown precisely; plausibly thousands to tens of thousands of Linux hosts with cifsacl/modefromsid/POSIX-extension mounts — Linux runs on well over 100 million systems, but only the subset using cifs.ko mounts that store the mode server-side (cifsacl, modefromsid, or negotiated POSIX/Unix extensions) is affected, and no public telemetry exists for that…

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: smb: client: clear setuid/setgid bit on write with cifsacl/modefromsid/posix extensions When a file has the setuid or setgid bit set and is written to, the VFS strips those bits and issues a setattr with ATTR_KILL_SUID/ATTR_KILL_SGID together with an ATTR_MODE carrying the already-cleared mode. Both cifs_setattr_unix() and cifs_setattr_nounix() unconditionally dropped ATTR_MODE in that case: /* skip mode change if it's just for clearing setuid/setgid */ if (attrs->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) attrs->ia_valid &= ~ATTR_MODE; This is fine for the default mount, where the mode is only emulated via the DOS read-only attribute and cannot represent the setuid/setgid bits anyway. However, with the "cifsacl" or "modefromsid" mount options the mode is stored on the server through an ACL (id_mode_to_cifs_acl()), with the SMB3.1.1 POSIX extensions the mode is sent to the server directly, and with the SMB1 Unix extensions (cifs_setattr_unix) the mode is sent via CIFSSMBUnixSetPathInfo(). In all those cases dropping ATTR_MODE means the cleared mode is never pushed to the server, so the setuid/setgid bit survives the write. This is a security issue: on local filesystems the setuid bit is stripped when a file is written, but over these cifs.ko mounts the bit persists on the server, potentially allowing an unexpected privilege escalation on subsequent execution. Fix this in two places: 1. cifs_setattr_nounix(): only take the "skip mode change" shortcut when the mode is emulated via the DOS read-only attribute (i.e. neither cifsacl/modefromsid nor the SMB3.1.1 POSIX extensions are in effect), so that the cleared mode is propagated to the server in the ACL / POSIX cases. 2. cifs_setattr_unix(): this function is only called when Unix extensions are in effect, so the mode is always stored on the server. Remove the shortcut entirely so that the cleared mode is always pushed.

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.