CVE-2026-72318: cifs: validate DFS referral string offsets
From: Greg Kroah-Hartman <[email protected]>
Description
===========
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.
The Linux kernel CVE team has assigned CVE-2026-72318 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.11 with commit 4ecce920e13ace16a5ba45efe8909946c28fb2ad and fixed in 6.1.178 with commit 76c607b9353d377b1d1b11db50e743eee0ccf658 Issue introduced in 4.11 with commit 4ecce920e13ace16a5ba45efe8909946c28fb2ad and fixed in 6.6.145 with commit d64b6be5740ce230aca184d8d224c75d9866045d Issue introduced in 4.11 with commit 4ecce920e13ace16a5ba45efe8909946c28fb2ad and fixed in 6.12.97 with commit 929a85932d14190988f1eafd6ee8cc68d66ace0b Issue introduced in 4.11 with commit 4ecce920e13ace16a5ba45efe8909946c28fb2ad and fixed in 6.18.40 with commit b784cd1c24d89bf71be2efe1e948ff7c03371e57 Issue introduced in 4.11 with commit 4ecce920e13ace16a5ba45efe8909946c28fb2ad and fixed in 7.1.5 with commit c37abc99bb3de3d3219ecef253d649f74117fd83 Issue introduced in 4.11 with commit 4ecce920e13ace16a5ba45efe8909946c28fb2ad and fixed in 7.2-rc3 with commit 027a84ac6b50c12ef767c15abfc58aa865820e9e
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-72318
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/smb/client/misc.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/76c607b9353d377b1d1b11db50e743eee0ccf658 https://git.kernel.org/stable/c/d64b6be5740ce230aca184d8d224c75d9866045d https://git.kernel.org/stable/c/929a85932d14190988f1eafd6ee8cc68d66ace0b https://git.kernel.org/stable/c/b784cd1c24d89bf71be2efe1e948ff7c03371e57 https://git.kernel.org/stable/c/c37abc99bb3de3d3219ecef253d649f74117fd83 https://git.kernel.org/stable/c/027a84ac6b50c12ef767c15abfc58aa865820e9e