# CVE-2025-39791: dm: dm-crypt: Do not partially accept write BIOs with zoned targets

> 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:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; 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.19% (percentile 5, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-09-11T16:56:39.397Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< 8864616719b6bbf92356bc89ff544b0cd484c656; \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< 52a2c4c60470352acf9cde7a2dfa661c1e67e796; \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< e549663849e5bb3b985dc2d293069f0d9747ae72
- Anyone running Linux 6.10

## Description

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

dm: dm-crypt: Do not partially accept write BIOs with zoned targets

Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max\_read\_size
and max\_write\_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.

For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:

1) Since dm-crypt relies on the block layer zone write plugging to
   handle zone append emulation using regular write operations, the
   reminder of a split write BIO will always be plugged into the target
   zone write plugged. Once the on-going write BIO finishes, this
   reminder BIO is unplugged and issued from the zone write plug work.
   If this reminder BIO itself needs to be split, the reminder will be
   re-issued and plugged again, but that causes a call to a
   blk\_queue\_enter(), which may block if a queue freeze operation was
   initiated. This results in a deadlock as DM submission still holds
   BIOs that the queue freeze side is waiting for.

2) dm-crypt relies on the emulation done by the block layer using
   regular write operations for processing zone append operations. This
   still requires to properly return the written sector as the BIO
   sector of the original BIO. However, this can be done correctly only
   and only if there is a single clone BIO used for processing the
   original zone append operation issued by the user. If the size of a
   zone append operation is larger than dm-crypt max\_write\_size, then
   the orginal BIO will be split and processed as a chain of regular
   write operations. Such chaining result in an incorrect written sector
   being returned to the zone append issuer using the original BIO
   sector.  This in turn results in file system data corruptions using
   xfs or btrfs.

Fix this by modifying get\_max\_request\_size() to always return the size
of the BIO to avoid it being split with dm\_accpet\_partial\_bio() in
crypt\_map(). get\_max\_request\_size() is renamed to
get\_max\_request\_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm\_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt\_alloc\_buffer() works correctly, set the dm-crypt
device max\_hw\_sectors limit to be at most
BIO\_MAX\_VECS \<\< PAGE\_SECTORS\_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt\_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.

This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.

This change also does not affect in any way regular dm-crypt block
devices.

## Affected and fixed versions

- Linux: \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< 8864616719b6bbf92356bc89ff544b0cd484c656; \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< 52a2c4c60470352acf9cde7a2dfa661c1e67e796; \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< e549663849e5bb3b985dc2d293069f0d9747ae72 (cvelist)
- Linux: 6.10 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-39791.md
Affected: Linux >= f211268ed1f9bdf48f06a3ead5f5d88437450579, < 8864616719b6bbf92356bc89ff544b0cd484c656; >= f211268ed1f9bdf48f06a3ead5f5d88437450579, < 52a2c4c60470352acf9cde7a2dfa661c1e67e796; >= f211268ed1f9bdf48f06a3ead5f5d88437450579, < e549663849e5bb3b985dc2d293069f0d9747ae72; Linux 6.10
Fixed in: Linux 8864616719b6bbf92356bc89ff544b0cd484c656, Linux 52a2c4c60470352acf9cde7a2dfa661c1e67e796

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-39791 being exploited?

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< 8864616719b6bbf92356bc89ff544b0cd484c656; \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< 52a2c4c60470352acf9cde7a2dfa661c1e67e796; \>= f211268ed1f9bdf48f06a3ead5f5d88437450579, \< e549663849e5bb3b985dc2d293069f0d9747ae72; Linux 6.10.

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

Yes. Fixed in Linux 8864616719b6bbf92356bc89ff544b0cd484c656, Linux 52a2c4c60470352acf9cde7a2dfa661c1e67e796. No fix listed yet: follow the vendor advisory.

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

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/8864616719b6bbf92356bc89ff544b0cd484c656>
- patch: <https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796>
- patch: <https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72>

## 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-39791>

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