CVE-2026-97554: smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr()
In the Linux kernel, the following vulnerability has been resolved:
smb: client: avoid using uninitialized SIDs in cifsposixtofattr()
cifsposixtofattr() ignores the return value of posixinfoparse(). When a malformed POSIX directory entry is encountered (e.g. invalid SID lengths from an untrusted server), posixinfoparse() returns -1 without populating the 'parsed' struct. The uninitialized stack memory in parsed.owner and parsed.group is then passed to sidtoid(), which processes the garbage bytes and passes them to requestkey() to construct a SID string, potentially leaking kernel stack contents to the userspace idmap daemon.
Fix this by checking the return value and skipping the SID-to-id mapping when parsing fails. The remaining fattr fields (timestamps, mode, etc.) are populated directly from the 'info' pointer so they are unaffected.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In cifs_posix_to_fattr(), check the return value of posix_info_parse() and skip SID-to-id mapping with sid_to_id() when parsing fails, so uninitialized SIDs are not used.
Event History
Frequently Asked Questions
Who can trigger the issue?
A CIFS/SMB client can be exposed when it processes a malformed POSIX directory entry from an untrusted SMB server, including entries with invalid SID lengths.
What information could be exposed?
Uninitialized kernel stack bytes from the parsed owner and group SID fields may be processed into a SID string and sent to the userspace idmap daemon through request_key().
What happens when parsing fails after the fix?
The client skips SID-to-ID mapping when POSIX information parsing fails. Other file attribute fields, including timestamps and mode, continue to be populated directly from the received information.