CVE-2026-138968: iommu/vt-d: Avoid out-of-range shift in qi_desc_dev_iotlb_pasid()
In the Linux kernel, the following vulnerability has been resolved:
iommu/vt-d: Avoid out-of-range shift in qidescdeviotlbpasid()
Callers request a full Device-TLB flush by passing MAXAGAWPFNWIDTH (64 - VTDPAGESHIFT == 52) as @sizeorder. Two expressions in qidescdeviotlbpasid() are not prepared for a value that large:
unsigned long mask = 1UL << (VTDPAGESHIFT + sizeorder - 1); ... if (!ISALIGNED(addr, VTDPAGESIZE << sizeorder))
The second evaluates to 1UL << 64, which is undefined on all architectures. On x8664 the shift count masks to zero, ISALIGNED(addr, 1) is trivially true, and the alignment sanity check silently degrades into a no-op.
The first evaluates to 1UL << 63. That is well defined on 64-bit builds, where unsigned long is 64 bits wide, but is undefined on 32-bit ones. In practice x86 masks the shift count to five bits, so the expression yields 1UL << 31 and ~mask becomes 0x7fffffff. That value is zero-extended when applied to the 64-bit descriptor, so
desc->qw1 &= ~mask;
clears qw1[63:32] as well as bit 31, collapsing the ADDR field that had just been filled with ones. Reaching that requires a scalable-mode PASID configuration on 32-bit x86, which is not a realistic deployment, but the construct is wrong regardless.
Compute the mask with BITULL() so that it is 64-bit on every architecture, and skip the alignment check for a full flush, where it is both meaningless and the source of the out-of-range shift.
Note that @sizeorder must not be clamped below 64 - VTDPAGESHIFT. With S set, hardware derives the invalidation range from the least significant zero bit N of ADDR and matches bits [63:N+1] of the incoming address. For sizeorder 52 the descriptor sets ADDR[63:12] and clears bit 63, making N = 63 and the comparison range empty, so everything is invalidated. Reducing @sizeorder to 51 would instead leave N = 62 and cause hardware to compare address bit 63; since callers pass an address of 0, only the lower half of the address space would be invalidated. Bound @sizeorder at 64 - VTDPAGESHIFT so that a bogus caller cannot reintroduce an out-of-range shift, without altering the full-flush encoding.
The non-PASID variant qidescdeviotlb() already uses 1ULL and is unaffected.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.117-1Fixed in 7.3.4-1 - Compensating control
In Linux kernel iommu/vt-d qi_desc_dev_iotlb_pasid(), compute the mask with BIT_ULL(), bound @size_order at 64 - VTD_PAGE_SHIFT, and skip the alignment check for a full flush (MAX_AGAW_PFN_WIDTH).
Event History
Frequently Asked Questions
Which systems have the concrete descriptor-corruption behavior described?
It requires a scalable-mode PASID configuration on 32-bit x86. On those systems, the out-of-range shift can cause the descriptor mask operation to clear the upper half of qw1 along with bit 31, collapsing the ADDR field.
What is the impact on x86_64 systems?
On x86_64, the shift count for the alignment check is masked to zero, making the check equivalent to testing alignment to 1 byte. The alignment sanity check therefore silently becomes ineffective for this full Device-TLB flush request.