iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ca3bf5d47cec8b7614bcb2e9132c40081d6d81db · < 10d901a95f8e766e5aa0bb9a983fb41271f64718| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iommu/amd: Fix potential buffer overflow in parse_ivrs_acpihid
There is a string parsing logic error which can lead to an overflow of hid or uid buffers. Comparing ACPIID_LEN against a total string length doesn't take into account the lengths of individual hid and uid buffers so the check is insufficient in some cases. For example if the length of hid string is 4 and the length of the uid string is 260, the length of str will be equal to ACPIID_LEN + 1 but uid string will overflow uid buffer which size is 256.
The same applies to the hid string with length 13 and uid string with length 250.
Check the length of hid and uid strings separately to prevent buffer overflow.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
From the CVE record · Linux
A length-check error in the Linux kernel’s AMD IOMMU parse_ivrs_acpihid function can overflow the hid or uid buffer. The input does not establish how an attacker could reach this code, whether authentication is needed, or whether user interaction is required.
Engineers running the Linux kernel should check their kernel versions; affected versions are not specified in the input.