cifs: validate DFS referral string offsets
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4ecce920e13ace16a5ba45efe8909946c28fb2ad · < 027a84ac6b50c12ef767c15abfc58aa865820e9e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
cifs: validate DFS referral string offsets
parse_dfs_referrals() validates that the response header and referral array fit in the received buffer, but each referral also contains string offsets supplied by the server.
Those offsets are used to compute the DfsPath and NetworkAddress string pointers without checking whether they still point inside the response buffer. A malformed referral can therefore make the computed pointer exceed the end of the buffer. The resulting negative max_len is then passed to cifs_strndup_from_utf16(), and the non-Unicode path forwards it to kstrndup() as a size_t, allowing strnlen() to read out of bounds.
Validate each string offset before deriving the string pointer.
From the CVE record · Linux
The Linux kernel’s CIFS DFS referral parser does not validate string offsets supplied by a server. A malformed referral from a server can cause an out-of-bounds read while parsing the response; the input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels that use CIFS DFS referrals should check whether their kernel is affected; affected versions are not specified.