CVE-2026-31444: ksmbd: fix use-after-free and NULL deref in smb_grant_oplock()
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix use-after-free and NULL deref in smb_grant_oplock()
smb_grant_oplock() has two issues in the oplock publication sequence:
1) opinfo is linked into ci->m_op_list (via opinfo_add) before
add_lease_global_list() is called. If add_lease_global_list()
fails (kmalloc returns NULL), the error path frees the opinfo
via __free_opinfo() while it is still linked in ci->m_op_list.
Concurrent m_op_list readers (opinfo_get_list, or direct iteration
in smb_break_all_levII_oplock) dereference the freed node.
2) opinfo->o_fp is assigned after add_lease_global_list() publishes
the opinfo on the global lease list. A concurrent
find_same_lease_key() can walk the lease list and dereference
opinfo->o_fp->f_ci while o_fp is still NULL.
Fix by restructuring the publication sequence to eliminate post-publish
failure:
- Set opinfo->o_fp before any list publication (fixes NULL deref).
- Preallocate lease_table via alloc_lease_table() before opinfo_add()
so add_lease_global_list() becomes infallible after publication.
- Keep the original m_op_list publication order (opinfo_add before
lease list) so concurrent opens via same_client_has_lease() and
opinfo_get_list() still see the in-flight grant.
- Use opinfo_put() instead of __free_opinfo() on err_out so that
the RCU-deferred free path is used.
This also requires splitting add_lease_global_list() to take a
preallocated lease_table and changing its return type from int to void,
since it can no longer fail.
Security readout for executives and security teams
Plain-English summary
A Linux kernel SMB server flaw can cause memory misuse or a crash when oplock data becomes visible to concurrent processing too early. The supplied CVSS score is 9.8, indicating potentially severe confidentiality, integrity, and availability impact. Actual risk depends on whether ksmbd is enabled, reachable, and missing the applicable stable-kernel fix.
Executive priority
Prioritize immediate exposure assessment and expedited patching for internet-facing or broadly reachable ksmbd servers. The technical impact and CVSS rating justify critical handling, while the absence of confirmed exploitation slightly reduces emergency-response urgency. Do not assume safety from version numbering alone; verify vendor backports.
Technical view
In ksmbd, smb_grant_oplock() could publish oplock state before initialization and failure handling were safe. Concurrent readers could access a freed opinfo or dereference a NULL o_fp. The fix initializes fields before publication, preallocates the lease table, removes post-publication allocation failure, and uses RCU-deferred opinfo_put() cleanup.
Likely exposure
Exposure is most plausible on systems running the Linux ksmbd SMB server with network-reachable SMB service and without the relevant stable-kernel commit. The bundle identifies fixed commits and versions marked unaffected, but does not provide complete vulnerable version ranges. Systems not using ksmbd are unlikely to reach this code path.
Exploitation context
The CVSS vector describes network access, low complexity, no privileges, and no user interaction. However, the supplied record is not in KEV and provides no evidence of exploitation in the wild or a public proof of concept. Treat exploitability as a serious potential risk, not confirmed active exploitation.
Researcher notes
The defect combines a dangling list entry after allocation failure with premature global lease publication before o_fp assignment. The remediation preserves m_op_list ordering for concurrent lease visibility while making subsequent global-list publication infallible. Complete vulnerable ranges, triggering reliability, and exploitation evidence are absent from the supplied sources.
Mitigation direction
Inventory systems running or loading ksmbd and identify their exact kernel builds.
Apply the vendor-supported kernel update containing the applicable referenced stable fix.
Restrict SMB access to trusted networks while updates are evaluated and deployed.
Check distribution or appliance vendor guidance for backported fixes and reboot requirements.
Validation and detection
Confirm ksmbd is disabled or the running kernel includes the applicable stable fix.
Compare vendor kernel changelogs against CVE-2026-31444 and the referenced commits.
Verify SMB exposure from relevant network zones using approved defensive asset discovery.
Monitor affected hosts for kernel crashes or ksmbd-related fault reports.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2026-31444 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
6Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.