CVE-2026-89638: smb: client: clear setuid/setgid bit on write with cifsacl/modefromsid/posix extensions

Published Sep 11, 2026
·
Updated

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 ATTRKILLSUID/ATTRKILLSGID together with an ATTRMODE carrying the already-cleared mode.

Both cifssetattrunix() and cifssetattrnounix() unconditionally dropped ATTRMODE in that case:

/ skip mode change if it's just for clearing setuid/setgid / if (attrs->iavalid & (ATTRKILLSUID|ATTRKILLSGID)) attrs->iavalid &= ~ATTRMODE;

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 (idmodetocifsacl()), with the SMB3.1.1 POSIX extensions the mode is sent to the server directly, and with the SMB1 Unix extensions (cifssetattrunix) the mode is sent via CIFSSMBUnixSetPathInfo(). In all those cases dropping ATTRMODE 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. cifssetattrnounix(): 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. cifssetattrunix(): 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.

Affected Software

1 affected component
Linux Linux kernel

Event History

Sep 11, 2026
CVE Published
via MITRE·07:45 PM
Data Sourced
via MITRE·07:45 PM
Description

Frequently Asked Questions

1

Which SMB client configurations are affected?

The issue affects mounts using the cifsacl or modefromsid options, SMB3.1.1 POSIX extensions, or SMB1 Unix extensions. The default mount configuration is not affected because it does not represent setuid or setgid bits in the server-side mode.

2

What condition triggers the incorrect behavior?

A file with setuid or setgid set must be written to. Although the Linux VFS clears those bits locally and requests a mode update, the SMB client can omit that mode update, leaving the setuid or setgid bit present on the server.

3

How can an administrator check for exposure?

Identify CIFS/SMB mounts using cifsacl, modefromsid, SMB3.1.1 POSIX extensions, or SMB1 Unix extensions. On those mounts, check whether writing a file that previously has setuid or setgid set leaves the corresponding bit set in the server-side file mode.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203