{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2025-39791", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2025-04-16T07:20:57.131Z", "datePublished": "2025-09-11T16:56:39.397Z", "dateUpdated": "2026-08-05T12:05:11.878Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T12:05:11.878Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndm: dm-crypt: Do not partially accept write BIOs with zoned targets\n\nRead and write operations issued to a dm-crypt target may be split\naccording to the dm-crypt internal limits defined by the max_read_size\nand max_write_size module parameters (default is 128 KB). The intent is\nto improve processing time of large BIOs by splitting them into smaller\noperations that can be parallelized on different CPUs.\n\nFor zoned dm-crypt targets, this BIO splitting is still done but without\nthe parallel execution to ensure that the issuing order of write\noperations to the underlying devices remains sequential. However, the\nsplitting itself causes other problems:\n\n1) Since dm-crypt relies on the block layer zone write plugging to\n handle zone append emulation using regular write operations, the\n reminder of a split write BIO will always be plugged into the target\n zone write plugged. Once the on-going write BIO finishes, this\n reminder BIO is unplugged and issued from the zone write plug work.\n If this reminder BIO itself needs to be split, the reminder will be\n re-issued and plugged again, but that causes a call to a\n blk_queue_enter(), which may block if a queue freeze operation was\n initiated. This results in a deadlock as DM submission still holds\n BIOs that the queue freeze side is waiting for.\n\n2) dm-crypt relies on the emulation done by the block layer using\n regular write operations for processing zone append operations. This\n still requires to properly return the written sector as the BIO\n sector of the original BIO. However, this can be done correctly only\n and only if there is a single clone BIO used for processing the\n original zone append operation issued by the user. If the size of a\n zone append operation is larger than dm-crypt max_write_size, then\n the orginal BIO will be split and processed as a chain of regular\n write operations. Such chaining result in an incorrect written sector\n being returned to the zone append issuer using the original BIO\n sector. This in turn results in file system data corruptions using\n xfs or btrfs.\n\nFix this by modifying get_max_request_size() to always return the size\nof the BIO to avoid it being split with dm_accpet_partial_bio() in\ncrypt_map(). get_max_request_size() is renamed to\nget_max_request_sectors() to clarify the unit of the value returned\nand its interface is changed to take a struct dm_target pointer and a\npointer to the struct bio being processed. In addition to this change,\nto ensure that crypt_alloc_buffer() works correctly, set the dm-crypt\ndevice max_hw_sectors limit to be at most\nBIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).\nThis forces DM core to split write BIOs before passing them to\ncrypt_map(), and thus guaranteeing that dm-crypt can always accept an\nentire write BIO without needing to split it.\n\nThis change does not have any effect on the read path of dm-crypt. Read\noperations can still be split and the BIO fragments processed in\nparallel. There is also no impact on the performance of the write path\ngiven that all zone write BIOs were already processed inline instead of\nin parallel.\n\nThis change also does not affect in any way regular dm-crypt block\ndevices." } ], "metrics": [ { "cvssV3_1": { "version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH" }, "scenarios": [ { "lang": "en", "value": "AV:L - The vulnerable code is in the device-mapper/block layer, reached by issuing writes to a locally mounted filesystem or block device backed by a zoned dm-crypt target. No network protocol handler is involved.\nAC:L - Any write producing a zone append larger than dm-crypt's 128 KB default max_write_size deterministically causes the wrong written sector to be returned; there is no race to win, no memory layout to groom, and the emulated max_zone_append_sectors is far above 128 KB so ordinary large-file writeback triggers it every time.\nPR:L - An unprivileged local user with write access to a file on an XFS or btrfs filesystem hosted on the zoned dm-crypt device can trigger it by writing a file larger than 128 KB. The CAP_SYS_ADMIN needed to create the dm-crypt target is a property of the deployed configuration, not a barrier the attacker must cross.\nUI:N - Triggering requires only the attacker's own write I/O; no action by any other user or administrator is needed once the affected storage stack is in use.\nS:U - The impact — corrupted filesystem extents and hung block I/O — stays within the kernel and storage stack of the same system, with no crossing into a different security authority such as a hypervisor or IOMMU boundary.\nC:H - XFS commits bmap extent records built from the incorrect returned sector, and because xfs_zoned_pack_tight() packs multiple inodes into a single zone and XFS has no data checksums, subsequent reads silently return the decrypted plaintext of other files — potentially other users' data — from the encrypted device.\nI:H - The wrong written sector is committed into persistent on-disk filesystem metadata, producing silent, unrecoverable data corruption in XFS and btrfs as explicitly stated by the fix; extents point at physical blocks owned by other files, corrupting both attacker and victim data.\nA:H - The split remainder BIO is re-issued from the zone write plug work and calls blk_queue_enter(), deadlocking against a queue freeze that is waiting on BIOs DM still holds, hanging all I/O to the device; the resulting extent and space-accounting corruption also trips filesystem verifiers and forces an XFS/btrfs shutdown." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/md/dm-crypt.c" ], "versions": [ { "version": "f211268ed1f9bdf48f06a3ead5f5d88437450579", "lessThan": "8864616719b6bbf92356bc89ff544b0cd484c656", "status": "affected", "versionType": "git" }, { "version": "f211268ed1f9bdf48f06a3ead5f5d88437450579", "lessThan": "52a2c4c60470352acf9cde7a2dfa661c1e67e796", "status": "affected", "versionType": "git" }, { "version": "f211268ed1f9bdf48f06a3ead5f5d88437450579", "lessThan": "e549663849e5bb3b985dc2d293069f0d9747ae72", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "drivers/md/dm-crypt.c" ], "versions": [ { "version": "6.10", "status": "affected" }, { "version": "0", "lessThan": "6.10", "status": "unaffected", "versionType": "semver" }, { "version": "6.12.44", "lessThanOrEqual": "6.12.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.16.4", "lessThanOrEqual": "6.16.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.17", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.10", "versionEndExcluding": "6.12.44" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.10", "versionEndExcluding": "6.16.4" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.10", "versionEndExcluding": "6.17" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/8864616719b6bbf92356bc89ff544b0cd484c656" }, { "url": "https://git.kernel.org/stable/c/52a2c4c60470352acf9cde7a2dfa661c1e67e796" }, { "url": "https://git.kernel.org/stable/c/e549663849e5bb3b985dc2d293069f0d9747ae72" } ], "title": "dm: dm-crypt: Do not partially accept write BIOs with zoned targets", "x_generator": { "engine": "bippy-1.2.0" } } } }