CVE-2025-38141

In the Linux kernel, the following vulnerability has been resolved: dm: fix dm_blk_report_zones If dm_get_live_table() returned NULL, dm_put_live_table() was never called. Also, it is possible that md->zone_revalidate_map will change while calling this function. Only read it once, so that we are always using the same value. Otherwise we might miss a call to dm_put_live_table(). Finally, while md->zone_revalidate_map is set and a process is calling blk_revalidate_disk_zones() to set up the zone append emulation resources, it is possible that another process, perhaps triggered by blkdev_report_zones_ioctl(), will call dm_blk_report_zones(). If blk_revalidate_disk_zones() fails, these resources can be freed while the other process is still using them, causing a use-after-free error. blk_revalidate_disk_zones() will only ever be called when initially setting up the zone append emulation resources, such as when setting up a zoned dm-crypt table for the first time. Further table swaps will not set md->zone_revalidate_map or call blk_revalidate_disk_zones(). However it must be called using the new table (referenced by md->zone_revalidate_map) and the new queue limits while the DM device is suspended. dm_blk_report_zones() needs some way to distinguish between a call from blk_revalidate_disk_zones(), which must be allowed to use md->zone_revalidate_map to access this not yet activated table, and all other calls to dm_blk_report_zones(), which should not be allowed while the device is suspended and cannot use md->zone_revalidate_map, since the zone resources might be freed by the process currently calling blk_revalidate_disk_zones(). Solve this by tracking the process that sets md->zone_revalidate_map in dm_revalidate_zones() and only allowing that process to make use of it in dm_blk_report_zones().
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*

History

20 Nov 2025, 20:10

Type Values Removed Values Added
First Time Linux
Linux linux Kernel
References () https://git.kernel.org/stable/c/37f53a2c60d03743e0eacf7a0c01c279776fef4e - () https://git.kernel.org/stable/c/37f53a2c60d03743e0eacf7a0c01c279776fef4e - Patch
References () https://git.kernel.org/stable/c/d19bc1b4dd5f322980b1f05f79b2ea4f0db10920 - () https://git.kernel.org/stable/c/d19bc1b4dd5f322980b1f05f79b2ea4f0db10920 - Patch
References () https://git.kernel.org/stable/c/f9c1bdf24615303d48a2d0fd629c88f3189563aa - () https://git.kernel.org/stable/c/f9c1bdf24615303d48a2d0fd629c88f3189563aa - Patch
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 7.8
CWE CWE-416
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: dm: fix dm_blk_report_zones Si dm_get_live_table() devolvía NULL, dm_put_live_table() nunca se llamaba. Además, es posible que md->zone_revalidate_map cambie al llamar a esta función. Solo léalo una vez, para que siempre usemos el mismo valor. De lo contrario, podríamos perder una llamada a dm_put_live_table(). Finalmente, mientras md->zone_revalidate_map está configurado y un proceso está llamando a blk_revalidate_disk_zones() para configurar los recursos de emulación de anexión de zona, es posible que otro proceso, quizás activado por blkdev_report_zones_ioctl(), llame a dm_blk_report_zones(). Si blk_revalidate_disk_zones() falla, estos recursos pueden liberarse mientras el otro proceso aún los está usando, causando un error de uso después de liberación. blk_revalidate_disk_zones() solo se llamará al configurar inicialmente los recursos de emulación de anexión de zona, como al configurar una tabla dm-crypt zonificada por primera vez. Los intercambios de tabla posteriores no establecerán md->zone_revalidate_map ni llamarán a blk_revalidate_disk_zones(). Sin embargo, debe llamarse utilizando la nueva tabla (referenciada por md->zone_revalidate_map) y los nuevos límites de cola mientras el dispositivo DM esté suspendido. dm_blk_report_zones() necesita distinguir entre una llamada a blk_revalidate_disk_zones(), que debe permitir el uso de md->zone_revalidate_map para acceder a esta tabla aún no activada, y todas las demás llamadas a dm_blk_report_zones(), que no deben permitirse mientras el dispositivo esté suspendido y no puedan usar md->zone_revalidate_map, ya que los recursos de la zona podrían ser liberados por el proceso que llama a blk_revalidate_disk_zones(). Para solucionar esto, se debe rastrear el proceso que establece md->zone_revalidate_map en dm_revalidate_zones() y permitir que solo ese proceso lo use en dm_blk_report_zones().

03 Jul 2025, 09:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-07-03 09:15

Updated : 2025-11-20 20:10


NVD link : CVE-2025-38141

Mitre link : CVE-2025-38141

CVE.ORG link : CVE-2025-38141


JSON object : View

Products Affected

linux

  • linux_kernel
CWE
CWE-416

Use After Free