Skip to contentSkip to conversation

CVE-2026-64390: ksmbd: track the connection owning a byte-range lock

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

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.

The Linux kernel CVE team has assigned CVE-2026-64390 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 5.15.212 with commit 22d38cf75b556c20b039743bdf3654d535b858be
	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 6.1.178 with commit 66eb3643164e5e1029907793926c132f8b5c6148
	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 6.6.145 with commit ea5c9bf99f626a15cc59f645dc895f2b3f01992e
	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 6.12.97 with commit fe20d492a69a6f79e637f438072b212e21ed3b78
	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 6.18.40 with commit 427faaa52b0b399940c1a88065a5c310d10dad15
	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 7.1.4 with commit 5fecc15a30cb9ebd310f7b52c1ab607edcea78f6
	Issue introduced in 5.15 with commit f5a544e3bab78142207e0242d22442db85ba1eff and fixed in 7.2-rc1 with commit c1016dd1d8b2bcd1158bbaabe94a31bb7e7431fb

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-64390

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/smb/server/smb2pdu.c
fs/smb/server/vfs_cache.c
fs/smb/server/vfs_cache.h

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	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