CVE-2026-64141: ksmbd: fix null pointer dereference in compare_guid_key()
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix null pointer dereference in compareguidkey()
sessionfdcheck() walks the per-inode moplist during durable-handle session teardown and sets op->conn = NULL for every opinfo whose conn matched the closing session's connection. The matching opinfo, however, stays linked in its per-ClientGuid leasetablelist entry's lb->leaselist because destroyleasetable() only runs on full TCP-connection teardown, not on SESSIONLOGOFF.
If the same TCP connection then negotiates a fresh session with the same ClientGuid (ClientGuid is bound to NEGOTIATE, not the session, and is unchanged across LOGOFF + SETUP) and issues a SMB2 CREATE with a lease context on a different inode, findsameleasekey() walks lb->leaselist, reaches the stale opinfo, and calls compareguidkey(), which unconditionally dereferences opinfo->conn->ClientGUID. The conn pointer is NULL and the kernel panics.
Reproducer requires only a successful SMB2 SESSIONSETUP and a share configured with 'durable handles = yes'. KASAN report on mainline 70390501d194:
general protection fault, probably for non-canonical address 0xdffffc0000000069: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000348-0x000000000000034f] Workqueue: ksmbd-io handleksmbdwork RIP: 0010:bcmp+0x5b/0x230 Call Trace: compareguidkey+0x4b/0xd0 findsameleasekey+0x324/0x690 smb2open+0x6aea/0x8e60 handleksmbdwork+0x796/0xee0 ...
Faulting address 0x348 is the offset of ClientGUID within struct ksmbdconn, confirming opinfo->conn was NULL.
Read opinfo->conn once and bail out if it has been cleared by a concurrent sessionfdcheck(). A half-detached opinfo cannot be the owner of an active lease, so returning 0 is the correct match result.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-64141?
The severity of CVE-2026-64141 is high with a CVSS score of 7.5.
What type of vulnerability is CVE-2026-64141?
CVE-2026-64141 is a null pointer dereference vulnerability in the Linux kernel.
How does CVE-2026-64141 affect Linux kernel users?
CVE-2026-64141 can lead to application crashes or undefined behavior for users of the affected Linux kernel.
How do I fix CVE-2026-64141?
To fix CVE-2026-64141, upgrade to the patched version of the Linux kernel that addresses this vulnerability.
When was CVE-2026-64141 published?
CVE-2026-64141 was published on July 19, 2026.