Skip to main content

Linux CVE-2025-21739

HIGH
Use After Free (CWE-416)
2025-02-27 416baaa9-dc9f-4396-8d5f-8c081fb06d67
7.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Gain local authenticated access
  2. Delivery
    Trigger UFS driver probe failure or device removal
  3. Exploit
    Race condition frees ufs_hba structure
  4. Install
    Manipulate heap to control freed memory
  5. C2
    Crypto cleanup callback dereferences freed pointer
  6. Execute
    Execute arbitrary kernel code
  7. Impact
    Achieve full system compromise

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires authenticated local access with low-level privileges (CVSS PR:L) on a Linux system running affected kernel versions. The system must use UFS (Universal Flash Storage) hardware with the ufshcd driver loaded. Exploitation requires triggering specific error conditions during UFS driver initialization (ufshcd_pltfrm_init failure path) or device removal sequences - achievable through physical device manipulation, sysfs device unbind operations (/sys/bus/platform/drivers/ufshcd/unbind), or module reload with crafted parameters. The vulnerability is NOT exploitable remotely (AV:L) and does NOT affect systems without UFS storage hardware or those using alternative storage technologies (NVMe, SATA, eMMC). User interaction is not required (UI:N) once local access is established. Default kernel configurations with UFS support enabled are vulnerable without additional hardening.

Impact

Real-world risk is moderate despite the high CVSS 7.8 score. The CVSS vector AV:L/AC:L/PR:L indicates local authenticated access with low complexity, limiting the attack surface to users with existing system access who can trigger driver initialization failures or device removal. The EPSS score of 0.04% (11th percentile) suggests extremely low observed exploitation activity in the wild. No CISA KEV listing confirms this is not being actively exploited. No public POC is identified at time of analysis. The SSVC framework assessment: exploitation status is none, automatable is no (requires local access and driver manipulation), technical impact is total (arbitrary code execution in kernel context). Primary risk scenarios involve privilege escalation on multi-tenant systems or supply-chain attacks targeting UFS storage systems. The vulnerability requires physical or authenticated access to systems using UFS storage with the affected kernel versions, plus the ability to trigger driver probe failures or removal - not typical attack conditions. Missing data: exact timeline of vendor awareness and patch deployment; whether virtualization or container isolation mitigates the local attack vector; confirmation of which specific UFS hardware controllers are affected beyond the CPE data.

Exploit ScenarioDerived

An authenticated local attacker with low privileges on a Linux system using UFS storage triggers a controlled UFS driver initialization failure (by manipulating device firmware interaction or inducing hardware errors during probe). This causes the error path in ufshcd_pltfrm_init() to execute, freeing the ufs_hba structure via ufshcd_dealloc_host(). Subsequently, when the platform device cleanup runs, the dangling crypto_profile pointer is dereferenced during blk_crypto_profile_destroy_callback(). By carefully timing heap manipulation and controlling the contents of the freed memory region, the attacker achieves arbitrary kernel code execution with full root privileges, bypassing security boundaries.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Apr 18, 2026

Use-after-free in Linux kernel UFS driver (versions 6.14-rc1 and earlier) allows local authenticated attackers to achieve arbitrary code execution, information disclosure, or denial of service. The flaw occurs during driver initialization error handling and removal paths when the crypto profile structure is freed before the device cleanup handler runs. Patches available from kernel.org (commits 0c77c0d, 9c185be, f8fb240) and distributions (Red Hat RHSA-2025:20518, multiple SUSE advisories). EPSS score 0.04% indicates low observed exploitation probability; no public exploit code or CISA KEV listing confirmed.

Earlier versions of this analysis (1)
v1 Mar 28, 2026 - 18:28 CVSS 7.8

In the Linux kernel, the following vulnerability has been resolved: scsi: ufs: core: Fix use-after free in init error and remove paths devm_blk_crypto_profile_init() registers a cleanup handler to. Rated high severity (CVSS 7.8), this vulnerability is low attack complexity. This Use After Free vulnerability could allow attackers to access freed memory to execute arbitrary code or crash the application.

RemediationAI

Apply vendor-released kernel patches immediately. Upstream fixes confirmed in kernel commits 0c77c0d754fe (https://git.kernel.org/stable/c/0c77c0d754fe83cb154715fcfec6c3faef94f207), 9c185beae09a (https://git.kernel.org/stable/c/9c185beae09a3eb85f54777edafa227f7e03075d), and f8fb2403ddeb (https://git.kernel.org/stable/c/f8fb2403ddebb5eea0033d90d9daae4c88749ada). For Red Hat systems, install updates from RHSA-2025:20518. For SUSE systems, apply relevant SUSE-SU advisories based on your kernel version. The fix restructures ufshcd_alloc_host() to use devres actions for automatic cleanup ordering, eliminating the need for explicit ufshcd_dealloc_host() calls and preventing future similar issues. No practical workarounds exist short of disabling UFS driver loading (modprobe blacklist ufshcd-core), which would render UFS storage devices unusable - acceptable only if no critical data resides on UFS volumes and alternative storage is available. Organizations unable to patch immediately should restrict physical access to affected systems and monitor for unexpected UFS driver reload attempts via kernel logs (dmesg | grep ufshcd), though this provides minimal security value against a determined local attacker.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in the Linux kernel SCSI UFS (Universal Flash Storage) subsystem, specifically in the ufshcd platform driver's device management code. The root cause is a CWE-416 use-after-free race condition between device resource cleanup ordering. The devm_blk_crypto_profile_init() function registers a cleanup handler tied to the platform device's lifecycle, but the crypto_profile structure itself is embedded within ufs_hba, which is allocated as part of the SCSI host and freed via scsi_host_put(). During error handling in ufshcd_pltfrm_init() or normal driver removal via ufshcd_dealloc_host(), the SCSI host (and embedded ufs_hba) is freed first, then the platform device release triggers blk_crypto_profile_destroy_callback() which accesses the already-freed crypto_profile memory. The fix restructures resource management using devres actions to ensure correct cleanup ordering: crypto profile resources are destroyed before the SCSI host they depend on.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
SUSE HIGH
Red Hat 6.7 MEDIUM

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Analysis Updated
Apr 18, 2026 - 09:47 vuln.today
v2 - CVSS changed
Patch released
Mar 28, 2026 - 18:28 nvd
Patch available
CVE Published
Feb 27, 2025 - 03:15 nvd
HIGH 7.8

DescriptionCVE.org

In the Linux kernel, the following vulnerability has been resolved:

scsi: ufs: core: Fix use-after free in init error and remove paths

devm_blk_crypto_profile_init() registers a cleanup handler to run when the associated (platform-) device is being released. For UFS, the crypto private data and pointers are stored as part of the ufs_hba's data structure 'struct ufs_hba::crypto_profile'. This structure is allocated as part of the underlying ufshcd and therefore Scsi_host allocation.

During driver release or during error handling in ufshcd_pltfrm_init(), this structure is released as part of ufshcd_dealloc_host() before the (platform-) device associated with the crypto call above is released. Once this device is released, the crypto cleanup code will run, using the just-released 'struct ufs_hba::crypto_profile'. This causes a use-after-free situation:

Call trace: kfree+0x60/0x2d8 (P) kvfree+0x44/0x60 blk_crypto_profile_destroy_callback+0x28/0x70 devm_action_release+0x1c/0x30 release_nodes+0x6c/0x108 devres_release_all+0x98/0x100 device_unbind_cleanup+0x20/0x70 really_probe+0x218/0x2d0

In other words, the initialisation code flow is:

platform-device probe ufshcd_pltfrm_init() ufshcd_alloc_host() scsi_host_alloc() allocation of struct ufs_hba creation of scsi-host devices devm_blk_crypto_profile_init() devm registration of cleanup handler using platform-device

and during error handling of ufshcd_pltfrm_init() or during driver removal:

ufshcd_dealloc_host() scsi_host_put() put_device(scsi-host) release of struct ufs_hba put_device(platform-device) crypto cleanup handler

To fix this use-after free, change ufshcd_alloc_host() to register a devres action to automatically cleanup the underlying SCSI device on ufshcd destruction, without requiring explicit calls to ufshcd_dealloc_host(). This way:

  • the crypto profile and all other ufs_hba-owned resources are

destroyed before SCSI (as they've been registered after)

  • a memleak is plugged in tc-dwc-g210-pci.c remove() as a

side-effect

  • EXPORT_SYMBOL_GPL(ufshcd_dealloc_host) can be removed fully as

it's not needed anymore

  • no future drivers using ufshcd_alloc_host() could ever forget

adding the cleanup

Executive ViewAI

Why It Matters

CVE-2025-21739 is a use-after-free vulnerability in the Linux kernel UFS driver affecting versions 6.14-rc1 and earlier, enabling local authenticated attackers to execute arbitrary code or cause system crashes. Organizations running affected kernel versions must prioritize patching to prevent privilege escalation and system compromise by users with local system access.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching unavailable: restrict local user access to affected systems, disable UFS driver if not operationally required, or isolate vulnerable systems from untrusted user populations pending kernel updates.

Threat Intelligence Overview

EPSS Score
0.0%
Top 89% exploitable
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Affected Products (CPE)CVE.org

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.14:rc1:*:*:*:*:*:*

Vendor StatusVendor

SUSE

Severity: High
Product Status
Container suse/hpc/warewulf4-x86_64/sle-hpc-node:15.7.20.5.1 Image SLES15-SP7-BYOS-Azure Image SLES15-SP7-BYOS-EC2 Image SLES15-SP7-BYOS-GCE Image SLES15-SP7-CHOST-BYOS-Aliyun Image SLES15-SP7-CHOST-BYOS-Azure Image SLES15-SP7-CHOST-BYOS-EC2 Image SLES15-SP7-CHOST-BYOS-GCE Image SLES15-SP7-CHOST-BYOS-GDC Image SLES15-SP7-CHOST-BYOS-SAP-CCloud Image SLES15-SP7-EC2 Image SLES15-SP7-EC2-ECS-HVM Image SLES15-SP7-GCE Image SLES15-SP7-GCE-3P Image SLES15-SP7-HPC-BYOS-Azure Image SLES15-SP7-HPC-BYOS-EC2 Image SLES15-SP7-HPC-BYOS-GCE Image SLES15-SP7-Hardened-BYOS-Azure Image SLES15-SP7-Hardened-BYOS-EC2 Image SLES15-SP7-Hardened-BYOS-GCE Image SLES15-SP7-SAPCAL-Azure Image SLES15-SP7-SAPCAL-EC2 Image SLES15-SP7-SAPCAL-GCE Affected
Container suse/sl-micro/6.0/base-os-container:2.1.3-6.11 Container suse/sl-micro/6.1/base-os-container:2.2.0-4.21 Image SL-Micro Image SL-Micro-Azure Image SL-Micro-BYOS-Azure Image SL-Micro-BYOS-EC2 Image SL-Micro-BYOS-GCE Image SL-Micro-EC2 Image SLE-Micro Image SLE-Micro-Azure Image SLE-Micro-BYOS Image SLE-Micro-BYOS-Azure Image SLE-Micro-BYOS-EC2 Image SLE-Micro-BYOS-GCE Image SLE-Micro-EC2 Image SLE-Micro-GCE Image SUSE-Multi-Linux-Manager-Proxy-BYOS-Azure Image SUSE-Multi-Linux-Manager-Proxy-BYOS-EC2 Image SUSE-Multi-Linux-Manager-Proxy-BYOS-GCE Image SUSE-Multi-Linux-Manager-Server-Azure-llc Image SUSE-Multi-Linux-Manager-Server-Azure-ltd Image SUSE-Multi-Linux-Manager-Server-BYOS-Azure Image SUSE-Multi-Linux-Manager-Server-BYOS-EC2 Image SUSE-Multi-Linux-Manager-Server-BYOS-GCE Image SUSE-Multi-Linux-Manager-Server-EC2-llc Image SUSE-Multi-Linux-Manager-Server-EC2-ltd Affected
Container suse/sl-micro/6.0/kvm-os-container:2.1.3-6.12 Container suse/sl-micro/6.1/kvm-os-container:2.2.0-4.20 Affected
Container suse/sl-micro/6.0/rt-os-container:2.1.3-7.15 Container suse/sl-micro/6.1/rt-os-container:2.2.0-4.21 Affected
Image SLES15-SP6-BYOS Image SLES15-SP6-BYOS-Azure Image SLES15-SP6-BYOS-EC2 Image SLES15-SP6-BYOS-GCE Image SLES15-SP6-CHOST-BYOS Image SLES15-SP6-CHOST-BYOS-Aliyun Image SLES15-SP6-CHOST-BYOS-Azure Image SLES15-SP6-CHOST-BYOS-EC2 Image SLES15-SP6-CHOST-BYOS-GCE Image SLES15-SP6-CHOST-BYOS-GDC Image SLES15-SP6-CHOST-BYOS-SAP-CCloud Image SLES15-SP6-EC2 Image SLES15-SP6-EC2-ECS-HVM Image SLES15-SP6-GCE Image SLES15-SP6-HPC-BYOS Image SLES15-SP6-HPC-BYOS-Azure Image SLES15-SP6-HPC-BYOS-EC2 Image SLES15-SP6-HPC-BYOS-GCE Image SLES15-SP6-HPC-EC2 Image SLES15-SP6-HPC-GCE Image SLES15-SP6-Hardened-BYOS Image SLES15-SP6-Hardened-BYOS-Azure Image SLES15-SP6-Hardened-BYOS-EC2 Image SLES15-SP6-Hardened-BYOS-GCE Image SLES15-SP6-SAP Image SLES15-SP6-SAP-Azure Image SLES15-SP6-SAP-EC2 Image SLES15-SP6-SAP-GCE Image SLES15-SP6-SAPCAL Image SLES15-SP6-SAPCAL-Azure Image SLES15-SP6-SAPCAL-EC2 Image SLES15-SP6-SAPCAL-GCE Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy