{"id":69974,"date":"2025-09-11T22:32:22","date_gmt":"2025-09-11T19:02:22","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-39791-dm-dm-crypt-do-not-partially-accept-write-bios-with-zoned-targets\/"},"modified":"2025-09-11T22:32:22","modified_gmt":"2025-09-11T19:02:22","slug":"cve-2025-39791-dm-dm-crypt-do-not-partially-accept-write-bios-with-zoned-targets","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-39791-dm-dm-crypt-do-not-partially-accept-write-bios-with-zoned-targets\/","title":{"rendered":"CVE-2025-39791 &#8211; dm: dm-crypt: Do not partially accept write BIOs with zoned targets"},"content":{"rendered":"<p><strong>CVE ID : <\/strong>CVE-2025-39791<br \/>\n<br \/>\n<strong>Published : <\/strong> Sept. 11, 2025, 5:15 p.m. | 1\u00a0hour, 26\u00a0minutes ago<br \/>\n<br \/>\n<strong>Description : <\/strong>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>dm: dm-crypt: Do not partially accept write BIOs with zoned targets<\/p>\n<p>Read and write operations issued to a dm-crypt target may be split<br \/>\naccording to the dm-crypt internal limits defined by the max_read_size<br \/>\nand max_write_size module parameters (default is 128 KB). The intent is<br \/>\nto improve processing time of large BIOs by splitting them into smaller<br \/>\noperations that can be parallelized on different CPUs.<\/p>\n<p>For zoned dm-crypt targets, this BIO splitting is still done but without<br \/>\nthe parallel execution to ensure that the issuing order of write<br \/>\noperations to the underlying devices remains sequential. However, the<br \/>\nsplitting itself causes other problems:<\/p>\n<p>1) Since dm-crypt relies on the block layer zone write plugging to<br \/>\n   handle zone append emulation using regular write operations, the<br \/>\n   reminder of a split write BIO will always be plugged into the target<br \/>\n   zone write plugged. Once the on-going write BIO finishes, this<br \/>\n   reminder BIO is unplugged and issued from the zone write plug work.<br \/>\n   If this reminder BIO itself needs to be split, the reminder will be<br \/>\n   re-issued and plugged again, but that causes a call to a<br \/>\n   blk_queue_enter(), which may block if a queue freeze operation was<br \/>\n   initiated. This results in a deadlock as DM submission still holds<br \/>\n   BIOs that the queue freeze side is waiting for.<\/p>\n<p>2) dm-crypt relies on the emulation done by the block layer using<br \/>\n   regular write operations for processing zone append operations. This<br \/>\n   still requires to properly return the written sector as the BIO<br \/>\n   sector of the original BIO. However, this can be done correctly only<br \/>\n   and only if there is a single clone BIO used for processing the<br \/>\n   original zone append operation issued by the user. If the size of a<br \/>\n   zone append operation is larger than dm-crypt max_write_size, then<br \/>\n   the orginal BIO will be split and processed as a chain of regular<br \/>\n   write operations. Such chaining result in an incorrect written sector<br \/>\n   being returned to the zone append issuer using the original BIO<br \/>\n   sector.  This in turn results in file system data corruptions using<br \/>\n   xfs or btrfs.<\/p>\n<p>Fix this by modifying get_max_request_size() to always return the size<br \/>\nof the BIO to avoid it being split with dm_accpet_partial_bio() in<br \/>\ncrypt_map(). get_max_request_size() is renamed to<br \/>\nget_max_request_sectors() to clarify the unit of the value returned<br \/>\nand its interface is changed to take a struct dm_target pointer and a<br \/>\npointer to the struct bio being processed. In addition to this change,<br \/>\nto ensure that crypt_alloc_buffer() works correctly, set the dm-crypt<br \/>\ndevice max_hw_sectors limit to be at most<br \/>\nBIO_MAX_VECS<br \/>\n<strong>Severity:<\/strong> 0.0 | NA<br \/>\n<br \/>\nVisit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-39791 Published : Sept. 11, 2025, 5:15 p.m. | 1\u00a0hour, 26\u00a0minutes ago 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 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-69974","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/69974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=69974"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/69974\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=69974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=69974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=69974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}