CVE-2025-38140 (GCVE-0-2025-38140)
Vulnerability from cvelistv5
Published
2025-07-03 08:35
Modified
2025-07-28 04:13
Severity ?
VLAI Severity ?
EPSS score ?
Summary
In the Linux kernel, the following vulnerability has been resolved:
dm: limit swapping tables for devices with zone write plugs
dm_revalidate_zones() only allowed new or previously unzoned devices to
call blk_revalidate_disk_zones(). If the device was already zoned,
disk->nr_zones would always equal md->nr_zones, so dm_revalidate_zones()
returned without doing any work. This would make the zoned settings for
the device not match the new table. If the device had zone write plug
resources, it could run into errors like bdev_zone_is_seq() reading
invalid memory because disk->conv_zones_bitmap was the wrong size.
If the device doesn't have any zone write plug resources, calling
blk_revalidate_disk_zones() will always correctly update device. If
blk_revalidate_disk_zones() fails, it can still overwrite or clear the
current disk->nr_zones value. In this case, DM must restore the previous
value of disk->nr_zones, so that the zoned settings will continue to
match the previous value that it fell back to.
If the device already has zone write plug resources,
blk_revalidate_disk_zones() will not correctly update them, if it is
called for arbitrary zoned device changes. Since there is not much need
for this ability, the easiest solution is to disallow any table reloads
that change the zoned settings, for devices that already have zone plug
resources. Specifically, if a device already has zone plug resources
allocated, it can only switch to another zoned table that also emulates
zone append. Also, it cannot change the device size or the zone size. A
device can switch to an error target.
References
Impacted products
{ "containers": { "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "drivers/md/dm-table.c", "drivers/md/dm-zone.c", "drivers/md/dm.c", "drivers/md/dm.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "ac8acb0bfd98a1c65f3ca9a3e217a766124eebd8", "status": "affected", "version": "bb37d77239af25cde59693dbe3fac04dd17d7b29", "versionType": "git" }, { "lessThan": "121218bef4c1df165181f5cd8fc3a2246bac817e", "status": "affected", "version": "bb37d77239af25cde59693dbe3fac04dd17d7b29", "versionType": "git" } ] }, { "defaultStatus": "affected", "product": "Linux", "programFiles": [ "drivers/md/dm-table.c", "drivers/md/dm-zone.c", "drivers/md/dm.c", "drivers/md/dm.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "status": "affected", "version": "5.14" }, { "lessThan": "5.14", "status": "unaffected", "version": "0", "versionType": "semver" }, { "lessThanOrEqual": "6.15.*", "status": "unaffected", "version": "6.15.3", "versionType": "semver" }, { "lessThanOrEqual": "*", "status": "unaffected", "version": "6.16", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "cpeMatch": [ { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.15.3", "versionStartIncluding": "5.14", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.16", "versionStartIncluding": "5.14", "vulnerable": true } ], "negate": false, "operator": "OR" } ] } ], "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndm: limit swapping tables for devices with zone write plugs\n\ndm_revalidate_zones() only allowed new or previously unzoned devices to\ncall blk_revalidate_disk_zones(). If the device was already zoned,\ndisk-\u003enr_zones would always equal md-\u003enr_zones, so dm_revalidate_zones()\nreturned without doing any work. This would make the zoned settings for\nthe device not match the new table. If the device had zone write plug\nresources, it could run into errors like bdev_zone_is_seq() reading\ninvalid memory because disk-\u003econv_zones_bitmap was the wrong size.\n\nIf the device doesn\u0027t have any zone write plug resources, calling\nblk_revalidate_disk_zones() will always correctly update device. If\nblk_revalidate_disk_zones() fails, it can still overwrite or clear the\ncurrent disk-\u003enr_zones value. In this case, DM must restore the previous\nvalue of disk-\u003enr_zones, so that the zoned settings will continue to\nmatch the previous value that it fell back to.\n\nIf the device already has zone write plug resources,\nblk_revalidate_disk_zones() will not correctly update them, if it is\ncalled for arbitrary zoned device changes. Since there is not much need\nfor this ability, the easiest solution is to disallow any table reloads\nthat change the zoned settings, for devices that already have zone plug\nresources. Specifically, if a device already has zone plug resources\nallocated, it can only switch to another zoned table that also emulates\nzone append. Also, it cannot change the device size or the zone size. A\ndevice can switch to an error target." } ], "providerMetadata": { "dateUpdated": "2025-07-28T04:13:19.143Z", "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux" }, "references": [ { "url": "https://git.kernel.org/stable/c/ac8acb0bfd98a1c65f3ca9a3e217a766124eebd8" }, { "url": "https://git.kernel.org/stable/c/121218bef4c1df165181f5cd8fc3a2246bac817e" } ], "title": "dm: limit swapping tables for devices with zone write plugs", "x_generator": { "engine": "bippy-1.2.0" } } }, "cveMetadata": { "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "assignerShortName": "Linux", "cveId": "CVE-2025-38140", "datePublished": "2025-07-03T08:35:41.929Z", "dateReserved": "2025-04-16T04:51:23.987Z", "dateUpdated": "2025-07-28T04:13:19.143Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "vulnerability-lookup:meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2025-38140\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-03T09:15:28.617\",\"lastModified\":\"2025-07-03T15:13:53.147\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ndm: limit swapping tables for devices with zone write plugs\\n\\ndm_revalidate_zones() only allowed new or previously unzoned devices to\\ncall blk_revalidate_disk_zones(). If the device was already zoned,\\ndisk-\u003enr_zones would always equal md-\u003enr_zones, so dm_revalidate_zones()\\nreturned without doing any work. This would make the zoned settings for\\nthe device not match the new table. If the device had zone write plug\\nresources, it could run into errors like bdev_zone_is_seq() reading\\ninvalid memory because disk-\u003econv_zones_bitmap was the wrong size.\\n\\nIf the device doesn\u0027t have any zone write plug resources, calling\\nblk_revalidate_disk_zones() will always correctly update device. If\\nblk_revalidate_disk_zones() fails, it can still overwrite or clear the\\ncurrent disk-\u003enr_zones value. In this case, DM must restore the previous\\nvalue of disk-\u003enr_zones, so that the zoned settings will continue to\\nmatch the previous value that it fell back to.\\n\\nIf the device already has zone write plug resources,\\nblk_revalidate_disk_zones() will not correctly update them, if it is\\ncalled for arbitrary zoned device changes. Since there is not much need\\nfor this ability, the easiest solution is to disallow any table reloads\\nthat change the zoned settings, for devices that already have zone plug\\nresources. Specifically, if a device already has zone plug resources\\nallocated, it can only switch to another zoned table that also emulates\\nzone append. Also, it cannot change the device size or the zone size. A\\ndevice can switch to an error target.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: dm: limitar el intercambio de tablas para dispositivos con conectores de escritura de zona. dm_revalidate_zones() solo permit\u00eda que los dispositivos nuevos o previamente no zonificados llamaran a blk_revalidate_disk_zones(). Si el dispositivo ya estaba zonificado, disk-\u0026gt;nr_zones siempre ser\u00eda igual a md-\u0026gt;nr_zones, por lo que dm_revalidate_zones() regresaba sin realizar ning\u00fan trabajo. Esto har\u00eda que la configuraci\u00f3n zonificada para el dispositivo no coincidiera con la nueva tabla. Si el dispositivo ten\u00eda recursos de conector de escritura de zona, podr\u00eda encontrarse con errores como bdev_zone_is_seq() leyendo memoria no v\u00e1lida porque disk-\u0026gt;conv_zones_bitmap ten\u00eda un tama\u00f1o incorrecto. Si el dispositivo no tiene ning\u00fan recurso de conector de escritura de zona, llamar a blk_revalidate_disk_zones() siempre actualizar\u00e1 correctamente el dispositivo. Si blk_revalidate_disk_zones() falla, a\u00fan puede sobrescribir o borrar el valor actual de disk-\u0026gt;nr_zones. En este caso, DM debe restaurar el valor anterior de disk-\u0026gt;nr_zones para que la configuraci\u00f3n de zonas siga siendo la misma que la anterior. Si el dispositivo ya cuenta con recursos de complemento de escritura de zona, blk_revalidate_disk_zones() no los actualizar\u00e1 correctamente si se le solicita para realizar cambios arbitrarios en el dispositivo de zona. Dado que esta funci\u00f3n no es muy necesaria, la soluci\u00f3n m\u00e1s sencilla es impedir cualquier recarga de tabla que modifique la configuraci\u00f3n de zonas en los dispositivos que ya cuentan con recursos de complemento de zona. En concreto, si un dispositivo ya tiene asignados recursos de complemento de zona, solo puede cambiar a otra tabla de zonas que tambi\u00e9n emule la anexi\u00f3n de zona. Adem\u00e1s, no puede cambiar el tama\u00f1o del dispositivo ni el de la zona. Un dispositivo puede cambiar a un destino de error.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/121218bef4c1df165181f5cd8fc3a2246bac817e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/ac8acb0bfd98a1c65f3ca9a3e217a766124eebd8\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}" } }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…