{"api_version":"1","generated_at":"2026-09-12T12:04:55+00:00","cve":"CVE-2026-89635","urls":{"html":"https://cve.report/CVE-2026-89635","api":"https://cve.report/api/cve/CVE-2026-89635.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-89635","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-89635"},"summary":{"title":"ksmbd: only rebind the reopened file's own oplock on durable reconnect","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: only rebind the reopened file's own oplock on durable reconnect\n\nksmbd_reopen_durable_fd() walks the inode's m_op_list and rebinds every\ndetached oplock to the reconnecting session:\n\n\tlist_for_each_entry_rcu(op, &ci->m_op_list, op_entry,\n\t\t\t\tlockdep_is_held(&ci->m_lock)) {\n\t\tif (op->conn)\n\t\t\tcontinue;\n\t\top->conn = ksmbd_conn_get(fp->conn);\n\t\top->sess = work->sess;\n\t}\n\nThe only key is op->conn == NULL, which every detached durable handle on\nthat inode matches, not just the one owned by fp.  When two sessions hold\ndurable handles on the same file and both disconnect, reconnecting one of\nthem adopts the other session's oplock: op->sess is overwritten with the\nreconnecting session without taking a reference on it, while op->conn\npins the connection.\n\nThe sibling teardown path, session_fd_check(), keys on the identity of\nthe connection being torn down (op->conn == conn) rather than on shared\nstate, and so does not have this problem.\n\nOnce the adopting session is destroyed, ksmbd_session_destroy() frees it\nwhile the foreign oplock still points at it.  The reader in\nksmbd_close_fd_app_instance_id() validates only opinfo->conn, which is\nstill live thanks to the reference taken above, and then dereferences the\nstale session:\n\n\tif (!opinfo->conn) {\n\t\tup_read(&fp->f_ci->m_lock);\n\t\tgoto out;\n\t}\n\n\tft = &opinfo->sess->file_table;\n\twrite_lock(&ft->lock);\n\n  BUG: KASAN: slab-use-after-free in _raw_write_lock+0x74/0xd0\n  Write of size 4 at addr ffff88810a970528 by task kworker/0:0/9\n  Workqueue: ksmbd-io handle_ksmbd_work\n  Call Trace:\n   _raw_write_lock+0x74/0xd0\n   ksmbd_close_fd_app_instance_id+0x183/0x410\n   smb2_open+0x1346/0x4430\n   handle_ksmbd_work+0x2bb/0x7b0\n\nReached from an authenticated session against a share with the default\ndurable-handle and oplock configuration: two sessions open the same file\nwith a durable-v2 handle and an RH lease under distinct AppInstanceIds,\nboth log off, one reconnects with DH2C, and a later durable-v2 create\ncarrying the other AppInstanceId walks into the freed session.\n\nConstrain the loop to the oplock owned by the file being reopened.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-09-11 20:19:49","updated_at":"2026-09-11 20:19:49"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/3f220a0a62e6b9b391c9d1f0e6580b05173cc7f7","name":"https://git.kernel.org/stable/c/3f220a0a62e6b9b391c9d1f0e6580b05173cc7f7","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/74e3ef4630f004c0de40c0540648a5a4033c6c9d","name":"https://git.kernel.org/stable/c/74e3ef4630f004c0de40c0540648a5a4033c6c9d","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-89635","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-89635","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f363a0fb134a3eb9e47368b1edbd251fd76be84b 74e3ef4630f004c0de40c0540648a5a4033c6c9d git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected f363a0fb134a3eb9e47368b1edbd251fd76be84b 3f220a0a62e6b9b391c9d1f0e6580b05173cc7f7 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 7.2","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2.4 7.2.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/smb/server/vfs_cache.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"74e3ef4630f004c0de40c0540648a5a4033c6c9d","status":"affected","version":"f363a0fb134a3eb9e47368b1edbd251fd76be84b","versionType":"git"},{"lessThan":"3f220a0a62e6b9b391c9d1f0e6580b05173cc7f7","status":"affected","version":"f363a0fb134a3eb9e47368b1edbd251fd76be84b","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/smb/server/vfs_cache.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"7.2"},{"lessThan":"7.2","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"7.2.*","status":"unaffected","version":"7.2.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.3-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2.4","versionStartIncluding":"7.2","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3-rc1","versionStartIncluding":"7.2","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: only rebind the reopened file's own oplock on durable reconnect\n\nksmbd_reopen_durable_fd() walks the inode's m_op_list and rebinds every\ndetached oplock to the reconnecting session:\n\n\tlist_for_each_entry_rcu(op, &ci->m_op_list, op_entry,\n\t\t\t\tlockdep_is_held(&ci->m_lock)) {\n\t\tif (op->conn)\n\t\t\tcontinue;\n\t\top->conn = ksmbd_conn_get(fp->conn);\n\t\top->sess = work->sess;\n\t}\n\nThe only key is op->conn == NULL, which every detached durable handle on\nthat inode matches, not just the one owned by fp.  When two sessions hold\ndurable handles on the same file and both disconnect, reconnecting one of\nthem adopts the other session's oplock: op->sess is overwritten with the\nreconnecting session without taking a reference on it, while op->conn\npins the connection.\n\nThe sibling teardown path, session_fd_check(), keys on the identity of\nthe connection being torn down (op->conn == conn) rather than on shared\nstate, and so does not have this problem.\n\nOnce the adopting session is destroyed, ksmbd_session_destroy() frees it\nwhile the foreign oplock still points at it.  The reader in\nksmbd_close_fd_app_instance_id() validates only opinfo->conn, which is\nstill live thanks to the reference taken above, and then dereferences the\nstale session:\n\n\tif (!opinfo->conn) {\n\t\tup_read(&fp->f_ci->m_lock);\n\t\tgoto out;\n\t}\n\n\tft = &opinfo->sess->file_table;\n\twrite_lock(&ft->lock);\n\n  BUG: KASAN: slab-use-after-free in _raw_write_lock+0x74/0xd0\n  Write of size 4 at addr ffff88810a970528 by task kworker/0:0/9\n  Workqueue: ksmbd-io handle_ksmbd_work\n  Call Trace:\n   _raw_write_lock+0x74/0xd0\n   ksmbd_close_fd_app_instance_id+0x183/0x410\n   smb2_open+0x1346/0x4430\n   handle_ksmbd_work+0x2bb/0x7b0\n\nReached from an authenticated session against a share with the default\ndurable-handle and oplock configuration: two sessions open the same file\nwith a durable-v2 handle and an RH lease under distinct AppInstanceIds,\nboth log off, one reconnects with DH2C, and a later durable-v2 create\ncarrying the other AppInstanceId walks into the freed session.\n\nConstrain the loop to the oplock owned by the file being reopened."}],"providerMetadata":{"dateUpdated":"2026-09-11T19:45:29.551Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/74e3ef4630f004c0de40c0540648a5a4033c6c9d"},{"url":"https://git.kernel.org/stable/c/3f220a0a62e6b9b391c9d1f0e6580b05173cc7f7"}],"title":"ksmbd: only rebind the reopened file's own oplock on durable reconnect","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-89635","datePublished":"2026-09-11T19:45:29.551Z","dateReserved":"2026-09-11T19:38:34.739Z","dateUpdated":"2026-09-11T19:45:29.551Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-09-11 20:19:49","lastModifiedDate":"2026-09-11 20:19:49","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"89635","Ordinal":"1","Title":"ksmbd: only rebind the reopened file's own oplock on durable rec","CVE":"CVE-2026-89635","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"89635","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: only rebind the reopened file's own oplock on durable reconnect\n\nksmbd_reopen_durable_fd() walks the inode's m_op_list and rebinds every\ndetached oplock to the reconnecting session:\n\n\tlist_for_each_entry_rcu(op, &ci->m_op_list, op_entry,\n\t\t\t\tlockdep_is_held(&ci->m_lock)) {\n\t\tif (op->conn)\n\t\t\tcontinue;\n\t\top->conn = ksmbd_conn_get(fp->conn);\n\t\top->sess = work->sess;\n\t}\n\nThe only key is op->conn == NULL, which every detached durable handle on\nthat inode matches, not just the one owned by fp.  When two sessions hold\ndurable handles on the same file and both disconnect, reconnecting one of\nthem adopts the other session's oplock: op->sess is overwritten with the\nreconnecting session without taking a reference on it, while op->conn\npins the connection.\n\nThe sibling teardown path, session_fd_check(), keys on the identity of\nthe connection being torn down (op->conn == conn) rather than on shared\nstate, and so does not have this problem.\n\nOnce the adopting session is destroyed, ksmbd_session_destroy() frees it\nwhile the foreign oplock still points at it.  The reader in\nksmbd_close_fd_app_instance_id() validates only opinfo->conn, which is\nstill live thanks to the reference taken above, and then dereferences the\nstale session:\n\n\tif (!opinfo->conn) {\n\t\tup_read(&fp->f_ci->m_lock);\n\t\tgoto out;\n\t}\n\n\tft = &opinfo->sess->file_table;\n\twrite_lock(&ft->lock);\n\n  BUG: KASAN: slab-use-after-free in _raw_write_lock+0x74/0xd0\n  Write of size 4 at addr ffff88810a970528 by task kworker/0:0/9\n  Workqueue: ksmbd-io handle_ksmbd_work\n  Call Trace:\n   _raw_write_lock+0x74/0xd0\n   ksmbd_close_fd_app_instance_id+0x183/0x410\n   smb2_open+0x1346/0x4430\n   handle_ksmbd_work+0x2bb/0x7b0\n\nReached from an authenticated session against a share with the default\ndurable-handle and oplock configuration: two sessions open the same file\nwith a durable-v2 handle and an RH lease under distinct AppInstanceIds,\nboth log off, one reconnects with DH2C, and a later durable-v2 create\ncarrying the other AppInstanceId walks into the freed session.\n\nConstrain the loop to the oplock owned by the file being reopened.","Type":"Description","Title":"ksmbd: only rebind the reopened file's own oplock on durable rec"}]}}}