smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 9934430e2178d5164eb1ac91a9b092f9e7e64745 · < da6e25842431982d5a53cf00d925b98c690f4467| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smb: client: avoid using uninitialized SIDs in cifs_posix_to_fattr()
cifs_posix_to_fattr() ignores the return value of posix_info_parse(). When a malformed POSIX directory entry is encountered (e.g. invalid SID lengths from an untrusted server), posix_info_parse() returns -1 without populating the 'parsed' struct. The uninitialized stack memory in parsed.owner and parsed.group is then passed to sid_to_id(), which processes the garbage bytes and passes them to request_key() 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.
From the CVE record · Linux
The Linux kernel SMB client can use uninitialized SID data when it parses a malformed POSIX directory entry from an untrusted server. The resulting SID-to-ID mapping can leak kernel stack contents to the userspace idmap daemon.
Engineers running Linux kernel SMB clients should check their installations; affected versions were not specified.