CVE-2026-142813: ksmbd: use the existing xattr name for a named stream
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: use the existing xattr name for a named stream
SMB stream names are case-insensitive, but ksmbd stores each named stream in an xattr whose name is case-sensitive. Opening an existing stream finds its xattr with a case-insensitive match, yet the handle keeps the name as the client spelled it, and every later operation that needs an exact name uses that spelling:
- a WRITE or an end-of-file change creates a second xattr, so a stream created as "Foo" and written through "foo" ends up stored twice, and which value a later lookup returns depends on xattr list order; - delete-on-close and delete-pending removal can fail with -ENODATA, or remove only a case-variant copy and leave the original; - the share mode check compares stream names with strcmp(), so two opens of the same stream that differ only in case do not conflict.
Have ksmbdvfscasexattrlen() copy the matching xattr's name into the handle when the stream is opened, so later operations use the name already on disk. The match must have the same length as the name it replaces; the stream lookup passes a length that includes the terminating NUL, which already guarantees that, and the check makes the copy safe for any caller. A stream that does not exist yet keeps the client's spelling, as before.
smb2rename() compares and looks up fp->stream.name case-insensitively, so it behaves the same with either spelling.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2
Event History
Frequently Asked Questions
Who is exposed to this issue?
Systems using ksmbd to serve SMB named streams are affected when clients access the same stream using different letter casing. The problem is specific to named streams backed by case-sensitive xattr names.
What does an attacker or client need to do to trigger the problem?
A client must open an existing named stream with a case variant of its stored name, such as opening "foo" after it was created as "Foo". Subsequent writes, end-of-file changes, deletion operations, or concurrent opens using different casing can trigger the inconsistent behavior.
What are the observable signs that a share may already be affected?
A single logical stream may have multiple xattrs whose names differ only by case, and later lookups may return different data depending on xattr list order. Stream deletion can fail with -ENODATA or leave an original case-variant stream behind, while opens differing only by case may bypass the expected share-mode conflict.