CVE-2026-138968

iommu/vt-d: Avoid out-of-range shift in qi_desc_dev_iotlb_pasid()

Published Nov 30, 2026 CVSS 3.1 · 2.3 Low EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

iommu/vt-d: Avoid out-of-range shift in qi_desc_dev_iotlb_pasid()

Callers request a full Device-TLB flush by passing MAX_AGAW_PFN_WIDTH
(64 - VTD_PAGE_SHIFT == 52) as @size_order. Two expressions in
qi_desc_dev_iotlb_pasid() are not prepared for a value that large:

unsigned long mask = 1UL << (VTD_PAGE_SHIFT + size_order - 1);
...
if (!IS_ALIGNED(addr, VTD_PAGE_SIZE << size_order))

The second evaluates to 1UL << 64, which is undefined on all
architectures. On x86_64 the shift count masks to zero, IS_ALIGNED(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 BIT_ULL() 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 @size_order must not be clamped below 64 - VTD_PAGE_SHIFT. 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
size_order 52 the descriptor sets ADDR[63:12] and clears bit 63, making
N = 63 and the comparison range empty, so everything is invalidated.
Reducing @size_order 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 @size_order
at 64 - VTD_PAGE_SHIFT so that a bogus caller cannot reintroduce an
out-of-range shift, without altering the full-flush encoding.

The non-PASID variant qi_desc_dev_iotlb() already uses 1ULL and is
unaffected.

Analysis

AI-generated

Technical impact

The vulnerability arises when a caller requests a full Device‑TLB flush by passing a size_order equal to the maximum possible value (MAX_AGAW_PFN_WIDTH). Two shift operations in qi_desc_dev_iotlb_pasid() treat this value as a bit shift count, producing an undefined shift on both 32‑bit and 64‑bit builds. On 32‑bit systems the mask calculation incorrectly clears the upper 32 bits of the descriptor, then a 1‑bit alignment check essentially becomes a no‑op, allowing the hardware to treat the descriptor as valid when it is not. This corruption can result in the kernel authorizing memory accesses that should have been invalidated, potentially causing memory integrity violations or disabling essential functionality. The primary risk is a degradation of kernel I/O translation table validity and possible denial of service if the kernel misbehaves after a failed flush. Affected systems are Linux kernel builds across all architectures, especially on x86 and x86‑64 platforms. Any kernel invoking qi_desc_dev_iotlb_pasid() with a size_order equal to 52 (the maximum for a 64‑bit system) falls under this vulnerability. There is no vendor‑specific product version list provided, so all current kernel releases are potentially impacted. Risk and exploitability assessment shows that the flaw is strictly a kernel‑internal logic error requiring control over the IOTLB flush interface. The vulnerability is not externally exposed and would need a privileged process to trigger. The CVSS score is not supplied, and EPSS is unavailable; the vulnerability is not listed in the CISA KEV catalog. Consequently, the risk is considered moderate, with a low probability of exploitation in the wild, but the impact on affected systems could be significant should the issue occur. The attack vector is inferred to be an internal kernel operation, reachable by a process with sufficient privileges to request a full IOTLB flush.

Affected Systems

All Linux kernel implementations that use the iommu/vt‑d subsystem are susceptible, particularly those built for x86 and x86‑64 processors where the shift calculations can be performed in a 32‑bit or 64‑bit context. The fix is relevant to any kernel that may invoke qi_desc_dev_iotlb_pasid() with the maximum size_order constant (MAX_AGAW_PFN_WIDTH). No specific vendor or product releases are enumerated, so all current and future kernel releases are presumed vulnerable until the patch is applied.

Risk and Exploitability

The flaw does not provide a direct attack vector such as a remote network call; it requires a legitimate process to trigger a full flush, which in practice is limited to privileged code paths. Because the bug does not immediately expose sensitive data, the primary consequence is a possible loss of IOTLB consistency and a degraded ability for the system to maintain correct memory mappings, which could translate into availability problems. The CVSS score is not stated, EPSS is unavailable, and the vulnerability is not yet included in KEV, indicating no known exploitation campaigns. Nevertheless, due to the kernel involvement and the subtle nature of the bug, it's advisable to remediate promptly.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the vendor patch or update to a kernel version that includes the corrected qi_desc_dev_iotlb_pasid() implementation.
  • If unable to update immediately, ensure that no code path passes MAX_AGAW_PFN_WIDTH as size_order to qi_desc_dev_iotlb_pasid(); instead use the documented maximum of 51 or lower values.
  • Monitor kernel logs for anomalous IOTLB flush failures or descriptor corruption warnings.
  • If VT‑d is not required for your deployment, consider disabling the iommu/vt‑d subsystem to eliminate the risk pathway.

Generated by OpenCVE AI on November 30, 2026 at 17:57 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-1335
References
Metrics threat_severity

None

cvssV3_1

{'score': 2.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:L'}

threat_severity

Low

Type Values Removed Values Added
First Time appeared Linux linux
Vendors & Products Linux linux
Type Values Removed Values Added
Weaknesses CWE-680
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: iommu/vt-d: Avoid out-of-range shift in qi_desc_dev_iotlb_pasid() Callers request a full Device-TLB flush by passing MAX_AGAW_PFN_WIDTH (64 - VTD_PAGE_SHIFT == 52) as @size_order. Two expressions in qi_desc_dev_iotlb_pasid() are not prepared for a value that large: unsigned long mask = 1UL << (VTD_PAGE_SHIFT + size_order - 1); ... if (!IS_ALIGNED(addr, VTD_PAGE_SIZE << size_order)) The second evaluates to 1UL << 64, which is undefined on all architectures. On x86_64 the shift count masks to zero, IS_ALIGNED(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 BIT_ULL() 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 @size_order must not be clamped below 64 - VTD_PAGE_SHIFT. 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 size_order 52 the descriptor sets ADDR[63:12] and clears bit 63, making N = 63 and the comparison range empty, so everything is invalidated. Reducing @size_order 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 @size_order at 64 - VTD_PAGE_SHIFT so that a bogus caller cannot reintroduce an out-of-range shift, without altering the full-flush encoding. The non-PASID variant qi_desc_dev_iotlb() already uses 1ULL and is unaffected.
Title iommu/vt-d: Avoid out-of-range shift in qi_desc_dev_iotlb_pasid()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-1335

    Incorrect Bitwise Shift of Integer

  • CWE-680

    Integer Overflow to Buffer Overflow

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:26 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:17 PM
Modified
Nov 30, 2026, 2:17 PM
Severity
Low
Public date
Nov 30, 2026, 1:26 PM