Sceawere

Vulnerability Detail

CVE-2026-89635UPDATED Verified Sceawere Triage Sources: NVD / CISA KEV

ksmbd Use-After-Free in Durable Reconnect

Vulnerability Metadata

Severity
Critical
Score / CVSS
9.8
Creation Date
1d ago
Vendor
Linux
Product
Linux
Attack Type
N/A
Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Complexity
LOW

Narrative and Response

Description

In the Linux kernel, the following vulnerability has been resolved: ksmbd: only rebind the reopened file's own oplock on durable reconnect ksmbd_reopen_durable_fd() walks the inode's m_op_list and rebinds every detached oplock to the reconnecting session: list_for_each_entry_rcu(op, &ci->m_op_list, op_entry, lockdep_is_held(&ci->m_lock)) { if (op->conn) continue; op->conn = ksmbd_conn_get(fp->conn); op->sess = work->sess; } The only key is op->conn == NULL, which every detached durable handle on that inode matches, not just the one owned by fp. When two sessions hold durable handles on the same file and both disconnect, reconnecting one of them adopts the other session's oplock: op->sess is overwritten with the reconnecting session without taking a reference on it, while op->conn pins the connection. The sibling teardown path, session_fd_check(), keys on the identity of the connection being torn down (op->conn == conn) rather than on shared state, and so does not have this problem. Once the adopting session is destroyed, ksmbd_session_destroy() frees it while the foreign oplock still points at it. The reader in ksmbd_close_fd_app_instance_id() validates only opinfo->conn, which is still live thanks to the reference taken above, and then dereferences the stale session: if (!opinfo->conn) { up_read(&fp->f_ci->m_lock); goto out; } ft = &opinfo->sess->file_table; write_lock(&ft->lock); BUG: KASAN: slab-use-after-free in _raw_write_lock+0x74/0xd0 Write of size 4 at addr ffff88810a970528 by task kworker/0:0/9 Workqueue: ksmbd-io handle_ksmbd_work Call Trace: _raw_write_lock+0x74/0xd0 ksmbd_close_fd_app_instance_id+0x183/0x410 smb2_open+0x1346/0x4430 handle_ksmbd_work+0x2bb/0x7b0 Reached from an authenticated session against a share with the default durable-handle and oplock configuration: two sessions open the same file with a durable-v2 handle and an RH lease under distinct AppInstanceIds, both log off, one reconnects with DH2C, and a later durable-v2 create carrying the other AppInstanceId walks into the freed session. Constrain the loop to the oplock owned by the file being reopened.

Executive Summary

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Executive Summary Locked

Sign up to unlock professional threat analysis, mitigations, and indicator signatures.

Technical Details

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Detailed Technical Analysis Locked

Sign up to unlock professional threat analysis, mitigations, and indicator signatures.

Mitigations

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Remediation & Mitigations Locked

Sign up to unlock professional threat analysis, mitigations, and indicator signatures.

References

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Intelligence References Locked

Sign up to unlock professional threat analysis, mitigations, and indicator signatures.

Additional Metadata

{
  "score": "9.8",
  "pubDate": "2026-09-11T20:19:49.120Z",
  "pubdate": "2026-09-11T20:19:49.120Z",
  "executiveSummary": "A use-after-free vulnerability exists in the ksmbd kernel module within the Linux kernel, specifically impacting how durable file handles are processed during session reconnection.\nThe vulnerability occurs because the ksmbd_reopen_durable_fd function incorrectly rebinds all detached oplocks associated with an inode to a reconnecting session, rather than limiting the operation to the specific handle being reopened.\nThis logic error allows a session to inadvertently adopt an oplock belonging to another session. When the original owner of the session is destroyed, the adopted oplock retains a pointer to the freed session memory.\nA subsequent access to this dangling pointer in ksmbd_close_fd_app_instance_id results in a slab-use-after-free, causing a kernel panic or potential arbitrary code execution.\nSuccessful exploitation requires an authenticated attacker capable of establishing multiple sessions and performing specific durable-handle and oplock operations on the same file.\nThe flaw impacts the stability and security of the SMB server implementation in the Linux kernel, posing a significant risk of local denial-of-service and potential memory corruption exploits.",
  "technicalDetails": "The root cause of the vulnerability lies in the loop implementation within ksmbd_reopen_durable_fd. When a durable handle is being reconnected, the kernel iterates through the inode's m_op_list to rebind detached oplocks. The criteria for binding is defined solely as 'op->conn == NULL'. This condition is satisfied by all detached durable handles associated with the inode, not just the handle being reconnected.\nIn a multi-user environment, if two distinct sessions maintain durable handles on the same file and both sessions disconnect, a reconnecting session will traverse the m_op_list and incorrectly rebind the foreign session's oplock to itself. This process overwrites the op->sess pointer without correctly managing references, effectively creating a stale reference to the original, now-orphaned session object.\nThe vulnerability is triggered during the teardown process of the adopting session. When ksmbd_session_destroy() is invoked, the session object is freed. However, because the foreign oplock still holds a pointer to this now-freed memory, subsequent operations that attempt to access the session structure via this oplock result in a use-after-free condition.\nThe attack flow proceeds as follows: 1) Two authenticated sessions open the same file using durable-v2 handles and RH leases under distinct AppInstanceIds. 2) Both sessions disconnect, leaving their respective oplocks in a detached state (op->conn == NULL). 3) One session initiates a reconnection using the DH2C (Durable Handle Reconnect) mechanism. 4) ksmbd_reopen_durable_fd incorrectly rebinds the other session's detached oplock to the reconnecting session. 5) The original session is destroyed, freeing the associated session structure. 6) A new file creation request arrives, triggering a lookup in ksmbd_close_fd_app_instance_id. 7) The function validates the connection, confirms it is live, but then attempts to dereference the stale opinfo->sess pointer to access the file_table, leading to a KASAN-detected slab-use-after-free.\nThis vulnerability highlights a critical lack of isolation in the handling of shared inodes in the ksmbd durable handle implementation, where the assumption of ownership is globally applied across an inode's op_list rather than being scoped to the specific file descriptor instance being restored."
}
CVE-2026-89635: ksmbd Use-After-Free in Durable Reconnect (CRITICAL Severity, CVSS: 9.8) | Sceawere