CVE-2025-40328

Description

A use-after-free flaw was found in the Linux kernel's SMB client implementation. In smb2_close_cached_fid(), a race condition exists where find_or_create_cached_dir() could acquire a new reference to a cached directory file ID (cfid) after kref_put() observed the reference count drop to zero but before the cfid_list_lock is acquired. This timing gap allows access to freed memory, potentially leading to system instability, data corruption, or privilege escalation.

Statement

This vulnerability requires local access and the ability to mount SMB/CIFS shares. The race condition window is narrow, making exploitation difficult but not impossible. Systems actively using SMB mounts are at higher risk.

Mitigation

To mitigate this issue, prevent the cifs module from being loaded if SMB/CIFS filesystem access is not required. See https://access.redhat.com/solutions/41278 for instructions on how to blacklist a kernel module.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

The following CVSS metrics and score provided are preliminary and subject to review.

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score7N/A8.8
Attack VectorLocalN/ANetwork
Attack ComplexityHighN/ALow
Privileges RequiredLowN/ANone
User InteractionNoneN/ARequired
ScopeUnchangedN/AUnchanged
ConfidentialityHighN/AHigh
Integrity ImpactHighN/AHigh
Availability ImpactHighN/AHigh

Vector

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

cve.org: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Frequently Asked Questions

Want to get errata notifications? Sign up here.