CVE-2026-139435: block: unpin all pages of a bvec in bio_iov_iter_align_down()
In the Linux kernel, the following vulnerability has been resolved:
block: unpin all pages of a bvec in bioioviteraligndown()
bioioviteraligndown() drops trailing bvecs with unpinuserpage(), but a bvec built by ioviterextractbvecs() can span several pages of one folio, each with its own pin. All but the first pin leak.
The partially trimmed bvec has the same problem. Shrinking bvlen does not release the pins for the pages cut off by the trim, and bioreleasepages() only unpins the pages bvlen still covers at completion.
Both issues occur only with a logical block size above PAGESIZE and a large folio backing the user buffer. On a device with a 64K logical block size, an ODIRECT pwritev() from a hugetlb mapping that ends 16K past a block boundary leaks one huge page per call, whether the remainder is its own bvec or the tail of a larger one.
Unpin all pages of a dropped bvec with bvecunpin(), and unpin the pages trimmed off the last bvec as well. Move bvecunpin() up and split its page count into a helper so both sites share it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In bio_iov_iter_align_down(), unpin every page in dropped bvecs and the pages trimmed from the last bvec using bvec_unpin().
Event History
Frequently Asked Questions
What systems are realistically exposed to this page-pin leak?
The issue occurs only when the storage device has a logical block size larger than PAGE_SIZE and the user buffer is backed by a large folio. The described example is a device with a 64K logical block size receiving an O_DIRECT pwritev() from a hugetlb mapping.
What workload triggers the leak?
An O_DIRECT pwritev() whose user-buffer range is trimmed at a block boundary can leak pins for pages omitted from dropped or partially trimmed bvecs. In the provided example, a write ending 16K past a block boundary leaks one huge page per call.
How can I tell whether the system is being affected?
Look for repeated qualifying O_DIRECT pwritev() operations against devices with logical block sizes above PAGE_SIZE, using buffers backed by large folios or hugetlb mappings. Under the described conditions, page pins leak on each affected call.