ksmbd: Do not skip lock checks for single-byte ranges
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5d510ac31626ed157d2182149559430350cf2104 · < d40c24634fe077a0dc91fd11fccf44ce12b454d5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: Do not skip lock checks for single-byte ranges
check_lock_range() uses inclusive ranges. Its callers pass the end offset as start + length - 1, so start == end represents a valid single-byte range rather than an empty range.
The start == end shortcut therefore skips mandatory byte-range lock checks for one-byte reads, writes, copychunk operations and one-byte truncate ranges. A conflicting lock covering that byte is not checked and the operation is allowed to proceed.
Remove the shortcut. The truncate size == inode->i_size case is already handled by only calling check_lock_range() when the new size differs from the current file size.
From the CVE record · Linux
The Linux kernel's ksmbd component skips mandatory byte-range lock checks for single-byte reads, writes, copychunk operations, and truncate ranges. An attacker able to perform one of these operations can proceed despite a conflicting lock on that byte. The input does not specify authentication or user-interaction requirements.
Engineers running Linux systems that use ksmbd should check their kernel; affected versions are not specified.