iommufd: Prevent ALIGN() overflow
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iommufd: Prevent ALIGN() overflow
When allocating IOVA the candidate range gets aligned to the target alignment. If the range is close to ULONG_MAX then the ALIGN() can wrap resulting in a corrupted iova.
Open code the ALIGN() using get_add_overflow() to prevent this. This simplifies the checks as we don't need to check for length earlier either.
Consolidate the two copies of this code under a single helper.
This bug would allow userspace to create a mapping that overlaps with some other mapping or a reserved range.
From the CVE record · Linux
The Linux kernel's iommufd IOVA allocation can overflow when aligning a candidate range near ULONG_MAX. A local userspace process could create a mapping that overlaps another mapping or a reserved range; authentication requirements and user interaction are not specified.
Engineers running Linux kernels with iommufd should check their versions against the vendor advisory; affected versions are not specified.