7.8
HIGH CVSS 3.1
CVE-2025-39791
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
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.

INFO

Published Date :

Sept. 11, 2025, 5:15 p.m.

Last Modified :

Oct. 19, 2026, 9:10 p.m.

Remotely Exploit :

No

Source :

416baaa9-dc9f-4396-8d5f-8c081fb06d67
Affected Products

The following products are affected by CVE-2025-39791 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Linux linux_kernel
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 134c704f-9b21-4f2e-91b3-4a467353bcc0
CVSS 3.1 MEDIUM [email protected]
CVSS 3.1 HIGH 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Solution
Update the Linux kernel to prevent deadlocks and data corruption.
  • Update the Linux kernel to the latest stable version.
  • Apply the patch for dm-crypt BIO splitting issues.
  • Verify that the max_hw_sectors limit is configured correctly.
  • Test for file system corruption after applying the fix.
References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2025-39791.

URL Resource
https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796 Patch
https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656 Patch
https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72 Patch
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2025-39791 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2025-39791 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2025-39791 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2025-39791 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Translated by [email protected]

    Oct. 19, 2026

    Action Type Old Value New Value
    Added Translation Title: Linux, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: dm: dm-crypt: No aceptar parcialmente BIOs de escritura con destinos zonificados Las operaciones de lectura y escritura emitidas a un destino dm-crypt pueden dividirse según los límites internos de dm-crypt definidos por los parámetros del módulo max_read_size y max_write_size (el valor predeterminado es 128 KB). La intención es mejorar el tiempo de procesamiento de BIOs grandes dividiéndolos en operaciones más pequeñas que pueden paralelizarse en diferentes CPUs. Para destinos dm-crypt zonificados, esta división de BIOs todavía se realiza pero sin la ejecución paralela para asegurar que el orden de emisión de las operaciones de escritura a los dispositivos subyacentes permanezca secuencial. Sin embargo, la división en sí causa otros problemas: 1) Dado que dm-crypt se basa en el 'zone write plugging' de la capa de bloques para manejar la emulación de 'zone append' utilizando operaciones de escritura regulares, el resto de un BIO de escritura dividido siempre se 'enchufará' en el 'zone write plugged' de destino. Una vez que el BIO de escritura en curso finaliza, este BIO restante se 'desenchufa' y se emite desde el trabajo de 'zone write plug'. Si este BIO restante necesita ser dividido, el resto será reemitido y 'enchufado' de nuevo, pero eso provoca una llamada a blk_queue_enter(), que puede bloquearse si se inició una operación de congelación de cola. Esto resulta en un interbloqueo ya que la presentación de DM todavía retiene BIOs que el lado de congelación de cola está esperando. 2) dm-crypt se basa en la emulación realizada por la capa de bloques utilizando operaciones de escritura regulares para procesar operaciones de 'zone append'. Esto todavía requiere devolver correctamente el sector escrito como el sector BIO del BIO original. Sin embargo, esto solo se puede hacer correctamente si hay un único BIO clon utilizado para procesar la operación de 'zone append' original emitida por el usuario. Si el tamaño de una operación de 'zone append' es mayor que dm-crypt max_write_size, entonces el BIO original se dividirá y procesará como una cadena de operaciones de escritura regulares. Dicha encadenación resulta en que se devuelve un sector escrito incorrecto al emisor de 'zone append' utilizando el sector BIO original. Esto a su vez resulta en corrupciones de datos del sistema de archivos utilizando xfs o btrfs. Solucione esto modificando get_max_request_size() para que siempre devuelva el tamaño del BIO para evitar que se divida con dm_accpet_partial_bio() en crypt_map(). get_max_request_size() se renombra a get_max_request_sectors() para aclarar la unidad del valor devuelto y su interfaz se cambia para que tome un puntero a struct dm_target y un puntero a la struct bio que se está procesando. Además de este cambio, para asegurar que crypt_alloc_buffer() funcione correctamente, establezca el límite max_hw_sectors del dispositivo dm-crypt en un máximo de BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB con una arquitectura de página de 4KB). Esto obliga al núcleo de DM a dividir los BIOs de escritura antes de pasarlos a crypt_map(), y así garantizando que dm-crypt siempre pueda aceptar un BIO de escritura completo sin necesidad de dividirlo. Este cambio no tiene ningún efecto en la ruta de lectura de dm-crypt. Las operaciones de lectura aún pueden dividirse y los fragmentos de BIO procesarse en paralelo. Tampoco hay impacto en el rendimiento de la ruta de escritura dado que todos los BIOs de escritura de zona ya se procesaban en línea en lugar de en paralelo. Este cambio tampoco afecta de ninguna manera a los dispositivos de bloques dm-crypt regulares.
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Oct. 15, 2026

    Action Type Old Value New Value
    Added Reference https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796
    Added Reference https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656
    Added Reference https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72
    Removed Reference https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796
    Removed Reference https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656
    Removed Reference https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72
    Removed Reference Type https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796 Types: Patch
    Removed Reference Type https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656 Types: Patch
    Removed Reference Type https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72 Types: Patch
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Oct. 15, 2026

    Action Type Old Value New Value
    Added SSVC {'id': 'CVE-2025-39791', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-10-15T21:54:11.714412Z'}
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Jul. 30, 2026

    Action Type Old Value New Value
    Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Jun. 17, 2026

    Action Type Old Value New Value
    Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': 'f211268ed1f9bdf48f06a3ead5f5d88437450579', 'lessThan': '8864616719b6bbf92356bc89ff544b0cd484c656', 'versionType': 'git'}, {'status': 'affected', 'version': 'f211268ed1f9bdf48f06a3ead5f5d88437450579', 'lessThan': '52a2c4c60470352acf9cde7a2dfa661c1e67e796', 'versionType': 'git'}, {'status': 'affected', 'version': 'f211268ed1f9bdf48f06a3ead5f5d88437450579', 'lessThan': 'e549663849e5bb3b985dc2d293069f0d9747ae72', 'versionType': 'git'}], 'programFiles': ['drivers/md/dm-crypt.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '6.10'}, {'status': 'unaffected', 'version': '0', 'lessThan': '6.10', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.12.44', 'versionType': 'semver', 'lessThanOrEqual': '6.12.*'}, {'status': 'unaffected', 'version': '6.16.4', 'versionType': 'semver', 'lessThanOrEqual': '6.16.*'}, {'status': 'unaffected', 'version': '6.17', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['drivers/md/dm-crypt.c'], 'defaultStatus': 'affected'}]
  • Initial Analysis by [email protected]

    Nov. 25, 2025

    Action Type Old Value New Value
    Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
    Added CWE CWE-667
    Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.13 up to (excluding) 6.16.4 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.10 up to (excluding) 6.12.44
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796 Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656 Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72 Types: Patch
  • New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Sep. 11, 2025

    Action Type Old Value New Value
    Added 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.
    Added Reference https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796
    Added Reference https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656
    Added Reference https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.