fs/smb/client: fix out-of-bounds read in cifs_sanitize_prepath
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a31080899d5fdafcccf7f39dd214a814a2c82626 · < 49b1ce6d7cfb6c5a49f68bf5ccfcfb6ba14e63c3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
fs/smb/client: fix out-of-bounds read in cifs_sanitize_prepath
When cifs_sanitize_prepath is called with an empty string or a string containing only delimiters (e.g., "/"), the current logic attempts to check *(cursor2 - 1) before cursor2 has advanced. This results in an out-of-bounds read.
This patch adds an early exit check after stripping prepended delimiters. If no path content remains, the function returns NULL.
The bug was identified via manual audit and verified using a standalone test case compiled with AddressSanitizer, which triggered a SEGV on affected inputs.
From the CVE record · Linux
The Linux kernel SMB client's cifs_sanitize_prepath function can read out of bounds when given an empty path or one containing only delimiters. The input does not establish how an attacker could supply such a path, or whether network access, authentication, or user interaction is required.
Teams running Linux kernels with the affected SMB client code should check their kernel versions; affected versions were not provided.