ksmbd: track the connection owning a byte-range lock
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f5a544e3bab78142207e0242d22442db85ba1eff · < 5fecc15a30cb9ebd310f7b52c1ab607edcea78f6| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: track the connection owning a byte-range lock
SMB2_LOCK adds each granted byte-range lock to both the file lock list and the lock list of the connection which handled the request. The final close and durable handle paths, however, remove the connection list entry while holding fp->conn->llist_lock.
With SMB3 multichannel, the connection handling the LOCK request can be different from the connection which opened the file. The entry can therefore be removed under a different spinlock from the one protecting the list it belongs to. A concurrent traversal can then access freed struct ksmbd_lock and struct file_lock objects.
Record the connection owning each lock's clist entry and hold a reference to it while the entry is linked. Use that connection and its llist_lock for unlock, rollback, close, and durable preserve. Durable reconnect assigns the new connection as the owner when publishing the locks again.
From the CVE record · Linux
The Linux kernel's ksmbd can remove an SMB2 byte-range lock from a connection list while holding the wrong spinlock. Under SMB3 multichannel, if the LOCK request uses a different connection from the one that opened the file, a concurrent traversal can access freed lock objects. The input does not specify authentication or user-interaction requirements.
Teams running Linux kernels with ksmbd should check their exposure; affected versions are not specified.