CVE-2026-89635: ksmbd: only rebind the reopened file's own oplock on durable reconnect

Published Sep 11, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

ksmbd: only rebind the reopened file's own oplock on durable reconnect

ksmbdreopendurablefd() walks the inode's moplist and rebinds every detached oplock to the reconnecting session:

listforeachentryrcu(op, &ci->moplist, opentry, lockdepisheld(&ci->mlock)) { if (op->conn) continue; op->conn = ksmbdconnget(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, sessionfdcheck(), 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, ksmbdsessiondestroy() frees it while the foreign oplock still points at it. The reader in ksmbdclosefdappinstanceid() validates only opinfo->conn, which is still live thanks to the reference taken above, and then dereferences the stale session:

if (!opinfo->conn) { upread(&fp->fci->mlock); goto out; }

ft = &opinfo->sess->filetable; writelock(&ft->lock);

BUG: KASAN: slab-use-after-free in rawwritelock+0x74/0xd0 Write of size 4 at addr ffff88810a970528 by task kworker/0:0/9 Workqueue: ksmbd-io handleksmbdwork Call Trace: rawwritelock+0x74/0xd0 ksmbdclosefdappinstanceid+0x183/0x410 smb2open+0x1346/0x4430 handleksmbdwork+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.

Affected Software

1 affected component
Linux Linux kernel

Event History

Sep 11, 2026
CVE Published
via MITRE·07:45 PM
Data Sourced
via MITRE·07:45 PM
Description

Frequently Asked Questions

1

What connection pattern is required for the described use-after-free condition?

The described condition involves two sessions holding durable handles for the same file, with both sessions disconnected. When one session reconnects, its reopen can adopt the other session’s detached oplock.

2

Why does reconnecting one session affect the other session's handle?

The reopen logic selects detached oplocks based only on a missing connection pointer, rather than verifying that the oplock belongs to the file being reopened. It can therefore assign the reconnecting session to a foreign oplock on the same inode.

3

What happens after the reconnecting session is torn down?

The foreign oplock can retain a pointer to the destroyed session. A later close path checks the oplock connection but not the validity of that session pointer, creating a use-after-free condition.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203