LiveActive security incident?Get immediate response
CVE Record

CVE-2025-40039: ksmbd: Fix race condition in RPC handle list access

In the Linux kernel, the following vulnerability has been resolved: ksmbd: Fix race condition in RPC handle list access The 'sess->rpc_handle_list' XArray manages RPC handles within a ksmbd session. Access to this list is intended to be protected by 'sess->rpc_lock' (an rw_semaphore). However, the locking implementation was flawed, leading to potential race conditions. In ksmbd_session_rpc_open(), the code incorrectly acquired only a read lock before calling xa_store() and xa_erase(). Since these operations modify the XArray structure, a write lock is required to ensure exclusive access and prevent data corruption from concurrent modifications. Furthermore, ksmbd_session_rpc_method() accessed the list using xa_load() without holding any lock at all. This could lead to reading inconsistent data or a potential use-after-free if an entry is concurrently removed and the pointer is dereferenced. Fix these issues by: 1. Using down_write() and up_write() in ksmbd_session_rpc_open() to ensure exclusive access during XArray modification, and ensuring the lock is correctly released on error paths. 2. Adding down_read() and up_read() in ksmbd_session_rpc_method() to safely protect the lookup.

HighCVSS 8.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A concurrency flaw in Linux’s ksmbd SMB server can corrupt RPC handle tracking when authenticated users trigger overlapping operations. The resulting inconsistent or freed memory access could compromise confidentiality, integrity, or availability. Systems are exposed only when they run affected kernels with ksmbd enabled and reachable.

Executive priority

Treat as a high-priority patching issue for exposed ksmbd file servers. Accelerate remediation where SMB is internet-accessible or broadly reachable by untrusted authenticated users. Systems not using ksmbd have substantially lower practical exposure, but inventory evidence should confirm that status.

Technical view

The session RPC handle XArray was modified under a read lock and queried without locking. Concurrent store, erase, and lookup operations could corrupt XArray state or produce a use-after-free. The kernel fix uses exclusive locking for modifications, shared locking for lookups, and correct lock release on error paths.

Likely exposure

Prioritize Linux systems using the in-kernel ksmbd SMB server, especially network-reachable file servers permitting low-privileged authenticated access. The supplied affected-version data is irregular and insufficient for reliable range determination; confirm exposure using distribution advisories, kernel package changelogs, and referenced fix commits.

Exploitation context

The supplied CVSS is 8.8 with network access, low complexity, low privileges, and no user interaction. However, the bundle marks KEV false and provides no evidence of active exploitation, public proof-of-concept availability, or confirmed attacks. Successful exploitation would likely depend on winning a concurrency race.

Researcher notes

The core issue is unsafe synchronization around sess->rpc_handle_list. Modification required write locking, while lookup required read locking to prevent inconsistent reads and use-after-free. The supplied version entries include unusual values and duplicate commit identifiers, so commit-level or distribution-specific verification is more reliable than interpreting the version list alone.

Mitigation direction

  • Install a vendor-supported kernel update containing the referenced ksmbd locking fixes.
  • If immediate patching is impossible, disable ksmbd where operationally acceptable.
  • Restrict SMB exposure to trusted networks and authorized users.
  • Check Linux distribution guidance for package-specific fixed versions.

Validation and detection

  • Confirm whether ksmbd is enabled, loaded, and serving SMB connections.
  • Identify the running kernel and distribution package release.
  • Check package changelogs for CVE-2025-40039 or referenced fix commits.
  • Verify SMB access is restricted to intended networks and accounts.
  • After updating, confirm the corrected kernel is running.
Prepared
Confidence
high
Sources
7

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-2025-40039 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
8.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/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
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.

ScoreVersionSeverityVectorExploitImpactSource
8.8CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H2.85.9Linux

Vulnerability scoring details

Base CVSS 3.1 score

8.8High
CVSS 3.1 vector shape for CVE-2025-40039Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/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
LinuxLinuxa4348710a7267705b75692dc1a000920481d1d92, b685757c7b08d5073046fb379be965fd6c06aafc, b685757c7b08d5073046fb379be965fd6c06aafc, b685757c7b08d5073046fb379be965fd6c06aafc, b685757c7b08d5073046fb379be965fd6c06aafc, 1f485b54d04a920723984062c912174330a05178, 052b41ef2abe274f068e892aee81406f11bd1f3a, 5.15.145unaffected
LinuxLinux6.3, 0, 6.6.123, 6.12.53, 6.17.3, 6.18affected
Weakness

CWE details

No CWE listed

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