Description
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.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
f5a544e3bab78142207e0242d22442db85ba1eff to < 22d38cf75b556c20b039743bdf3654d535b858beaffectedf5a544e3bab78142207e0242d22442db85ba1eff to < 66eb3643164e5e1029907793926c132f8b5c6148affectedf5a544e3bab78142207e0242d22442db85ba1eff to < ea5c9bf99f626a15cc59f645dc895f2b3f01992eaffectedf5a544e3bab78142207e0242d22442db85ba1eff to < fe20d492a69a6f79e637f438072b212e21ed3b78affectedf5a544e3bab78142207e0242d22442db85ba1eff to < 427faaa52b0b399940c1a88065a5c310d10dad15affectedf5a544e3bab78142207e0242d22442db85ba1eff to < 5fecc15a30cb9ebd310f7b52c1ab607edcea78f6affectedf5a544e3bab78142207e0242d22442db85ba1eff to < c1016dd1d8b2bcd1158bbaabe94a31bb7e7431fbaffected
Linux Linux
Default version status: affected
5.15affected0 to < 5.15unaffected5.15.212 to ≤ 5.15.*unaffected6.1.178 to ≤ 6.1.*unaffected6.6.145 to ≤ 6.6.*unaffected6.12.97 to ≤ 6.12.*unaffected6.18.40 to ≤ 6.18.*unaffected7.1.4 to ≤ 7.1.*unaffected7.2 to ≤ *unaffected
References
- https://git.kernel.org/stable/c/22d38cf75b556c20b039743bdf3654d535b858be ↗
- https://git.kernel.org/stable/c/66eb3643164e5e1029907793926c132f8b5c6148 ↗
- https://git.kernel.org/stable/c/ea5c9bf99f626a15cc59f645dc895f2b3f01992e ↗
- https://git.kernel.org/stable/c/fe20d492a69a6f79e637f438072b212e21ed3b78 ↗
- https://git.kernel.org/stable/c/427faaa52b0b399940c1a88065a5c310d10dad15 ↗
- https://git.kernel.org/stable/c/5fecc15a30cb9ebd310f7b52c1ab607edcea78f6 ↗
- https://git.kernel.org/stable/c/c1016dd1d8b2bcd1158bbaabe94a31bb7e7431fb ↗