HIGH Introduced in 6.9
ksmbd LeaseBreak Deadlock
CVE-2026-98897
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: don't hold ci->m_lock while waiting for a lease break ack When a cifs.ko client caches a read-handle (RH) lease via deferred close and a conflicting open arrives, ksmbd breaks the lease and waits for the acknowledgment in wait_for_break_ack() for up to OPLOCK_WAIT_TIME (35s). __smb_break_all_levII_oplock() runs that wait while holding ci->m_lock for read. cifs.ko reacts to a handle-lease break by closing the deferred handle rather than sending a lease break acknowledgment. That close path (close_id_del_oplock() -> opinfo_del()) takes ci->m_lock for write and is exactly what would wake the waiter, but it blocks on the read lock held by the waiting thread. The break is then resolved only by the 35s timeout, so xfstests generic/001 takes ~78s with leases enabled versus ~4s with oplocks only. Collect the target opinfos (each pinned with a reference) while holding ci->m_lock, then break them after releasing it, matching how smb_grant_oplock() already breaks a conflicting lease using only a reference. The reference keeps the opinfo (and its conn and lease) alive across the unlocked window, and a close racing the break is handled by the existing OPLOCK_CLOSING state check. Apply the same fix to the parent lease break paths.
02KernelScan AI Analysis
Risk summary
A remote attacker connecting to a ksmbd SMB server can trigger a kernel deadlock by opening a file with a conflicting lease after the client has cached a read-handle via deferred close. The server holds a read lock while waiting up to 35 seconds for a lease break acknowledgment that never arrives because the client's close path requires the write lock. This causes a sustained denial of service, degrading file operations from seconds to over a minute per request.
Vulnerability analysis
The ksmbd kernel SMB server incorrectly holds an inode read lock (ci->m_lock) while waiting for a lease break acknowledgment from the client. When a client caches a read-handle lease via deferred close and a conflicting open arrives, the server breaks the lease and blocks in wait_for_break_ack() for up to 35 seconds. The client responds by closing the deferred handle, but that close path needs the same lock for write and blocks on the server's read lock. This deadlock persists until the timeout expires. The fix collects the lease structures to be broken while holding the lock, pins them with references, releases the lock, and then performs the breaks — matching the existing pattern used in smb_grant_oplock(). Any unauthenticated or authenticated SMB client can trigger this by issuing the right sequence of open/close operations against a share with oplocks enabled.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.9 | 6.18.53 | 27a9bc968d4a |
| 6.6 | 6.6.35 | 6.7 | 868c9038ffd4 |
| mainline | 6.9 | 7.2 | — |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Affected — no CIP fix yet (latest 6.12.118-cip136) |