LiveActive security incident?Get immediate response
CVE Record

CVE-2026-31477: ksmbd: fix memory leaks and NULL deref in smb2_lock()

In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix memory leaks and NULL deref in smb2_lock() smb2_lock() has three error handling issues after list_del() detaches smb_lock from lock_list at no_check_cl: 1) If vfs_lock_file() returns an unexpected error in the non-UNLOCK path, goto out leaks smb_lock and its flock because the out: handler only iterates lock_list and rollback_list, neither of which contains the detached smb_lock. 2) If vfs_lock_file() returns -ENOENT in the UNLOCK path, goto out leaks smb_lock and flock for the same reason. The error code returned to the dispatcher is also stale. 3) In the rollback path, smb_flock_init() can return NULL on allocation failure. The result is dereferenced unconditionally, causing a kernel NULL pointer dereference. Add a NULL check to prevent the crash and clean up the bookkeeping; the VFS lock itself cannot be rolled back without the allocation and will be released at file or connection teardown. Fix cases 1 and 2 by hoisting the locks_free_lock()/kfree() to before the if(!rc) check in the UNLOCK branch so all exit paths share one free site, and by freeing smb_lock and flock before goto out in the non-UNLOCK branch. Propagate the correct error code in both cases. Fix case 3 by wrapping the VFS unlock in an if(rlock) guard and adding a NULL check for locks_free_lock(rlock) in the shared cleanup. Found via call-graph analysis using sqry.

HighCVSS 7.5Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A flaw in Linux’s in-kernel SMB server, ksmbd, can leak kernel memory or trigger a kernel crash while processing SMB file-lock errors. The supplied CVSS assessment indicates remote, unauthenticated impact to availability, with no user interaction required. Confidentiality and integrity impact are not identified.

Executive priority

Prioritize internet-facing or widely reachable ksmbd servers for prompt review and patching. The principal business risk is service or host disruption. Systems without ksmbd enabled have materially lower likely exposure, but configuration and vendor patch status should be verified.

Technical view

In smb2_lock(), error paths can lose references to detached lock objects, causing memory leaks and stale error reporting. A separate rollback path may dereference NULL if smb_flock_init() fails. The upstream changes free detached objects consistently, propagate correct errors, and guard allocation failure during rollback.

Likely exposure

Exposure is most relevant where ksmbd is enabled and reachable over a network. The supplied affected-version data spans several Linux release lines but is not sufficiently clear for exact package-level conclusions. Distribution backports may change status, so kernel build numbers alone are insufficient.

Exploitation context

The CVSS vector rates this as network-accessible, low-complexity, unauthenticated, and availability-only. However, the bundle reports KEV as false and provides no evidence of active exploitation or a public exploit. The faulty behavior occurs in SMB locking error and rollback paths.

Researcher notes

The defect combines two detached-object leaks with a NULL dereference after rollback allocation failure. The fix also corrects stale error propagation. The bundle does not establish whether ordinary remote inputs can reliably force every prerequisite error, so practical exploitability and denial-of-service reliability remain unconfirmed.

Mitigation direction

  • Apply a vendor kernel update containing the applicable upstream fix.
  • Check distribution advisories for backported fixes and package-specific status.
  • Disable ksmbd if it is unnecessary for business operations.
  • Restrict network access to SMB services to trusted systems.

Validation and detection

  • Inventory systems with ksmbd loaded, enabled, or configured.
  • Identify externally or broadly reachable SMB endpoints using ksmbd.
  • Map installed vendor kernels to their security advisories and backports.
  • Confirm the applicable upstream fix commit is present after updating.
  • Review kernel logs for ksmbd crashes or unusual memory pressure.
Prepared
Confidence
medium
Sources
8

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-31477 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

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
7Source 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.

ScoreVersionSeverityVectorExploitImpactSource
7.5CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H3.93.6Linux

Vulnerability scoring details

Base CVSS 3.1 score

7.5High
CVSS 3.1 vector shape for CVE-2026-31477Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
LinuxLinuxe2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9unaffected
LinuxLinux5.15, 0, 6.1.168, 6.6.131, 6.12.80, 6.18.21, 6.19.11, 7.0affected
Weakness

CWE details

No CWE listed

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.