# CVE-2025-38172: erofs: avoid using multiple devices with different type

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-07-03T08:36:10.334Z
- **Modified:** 2026-08-05T12:00:03.095Z

## Who should check

- Anyone running Linux \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< 65115472f741ca000d7ea4a5922214f93cd1516e; \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< cd04beb9ce2773a16057248bb4fa424068ae3807; \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< 9748f2f54f66743ac77275c34886a9f890e18409
- Anyone running Linux 6.12

## Description

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

erofs: avoid using multiple devices with different type

For multiple devices, both primary and extra devices should be the
same type. \`erofs\_init\_device\` has already guaranteed that if the
primary is a file-backed device, extra devices should also be
regular files.

However, if the primary is a block device while the extra device
is a file-backed device, \`erofs\_init\_device\` will get an ENOTBLK,
which is not treated as an error in \`erofs\_fc\_get\_tree\`, and that
leads to an UAF:

  erofs\_fc\_get\_tree
    get\_tree\_bdev\_flags(erofs\_fc\_fill\_super)
      erofs\_read\_superblock
        erofs\_init\_device  // sbi-\>dif0 is not inited yet,
                           // return -ENOTBLK
      deactivate\_locked\_super
        free(sbi)
    if (err is -ENOTBLK)
      sbi-\>dif0.file = filp\_open()  // sbi UAF

So if -ENOTBLK is hitted in \`erofs\_init\_device\`, it means the
primary device must be a block device, and the extra device
is not a block device. The error can be converted to -EINVAL.

## Affected and fixed versions

- Linux: \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< 65115472f741ca000d7ea4a5922214f93cd1516e; \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< cd04beb9ce2773a16057248bb4fa424068ae3807; \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< 9748f2f54f66743ac77275c34886a9f890e18409 (cvelist)
- Linux: 6.12 (cvelist)

## Mitigation

- Upgrade Linux to 9748f2f54f66743ac77275c34886a9f890e18409 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38172. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38172.md
Affected: Linux >= fb176750266a3d7f42ebdcf28e8ba40350b27847, < 65115472f741ca000d7ea4a5922214f93cd1516e; >= fb176750266a3d7f42ebdcf28e8ba40350b27847, < cd04beb9ce2773a16057248bb4fa424068ae3807; >= fb176750266a3d7f42ebdcf28e8ba40350b27847, < 9748f2f54f66743ac77275c34886a9f890e18409; Linux 6.12
Fixed in: Linux 65115472f741ca000d7ea4a5922214f93cd1516e, Linux 9748f2f54f66743ac77275c34886a9f890e18409

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38172 being exploited?

There is no confirmed exploitation: CVE-2025-38172 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38172?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2025-38172?

Linux \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< 65115472f741ca000d7ea4a5922214f93cd1516e; \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< cd04beb9ce2773a16057248bb4fa424068ae3807; \>= fb176750266a3d7f42ebdcf28e8ba40350b27847, \< 9748f2f54f66743ac77275c34886a9f890e18409; Linux 6.12.

### Is there a fix for CVE-2025-38172?

Yes. Fixed in Linux 65115472f741ca000d7ea4a5922214f93cd1516e, Linux 9748f2f54f66743ac77275c34886a9f890e18409. Upgrade Linux to 9748f2f54f66743ac77275c34886a9f890e18409 or later.

### How do I check if I'm affected by CVE-2025-38172?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/65115472f741ca000d7ea4a5922214f93cd1516e>
- patch: <https://git.kernel.org/stable/c/cd04beb9ce2773a16057248bb4fa424068ae3807>
- patch: <https://git.kernel.org/stable/c/9748f2f54f66743ac77275c34886a9f890e18409>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38172>

HTML: <https://flawdb.com/CVE-2025-38172> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38172>
