mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
iommu/amd: Bound the early ACPI HID map
The ivrs_acpihid command-line parser appends entries to a fixed
four-element early_acpihid_map array. Unlike the sibling IOAPIC and HPET
parsers, it does not reject a fifth entry before incrementing the map size.
Check the capacity at the common found label before parsing the HID and
UID or writing the entry.
Fixes: ca3bf5d47c ("iommu/amd: Introduces ivrs_acpihid kernel parameter")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Reviewed-by: Ankit Soni <Ankit.Soni@amd.com>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
780dfed688
commit
fb80117fdd
@@ -3864,6 +3864,12 @@ not_found:
|
||||
return 1;
|
||||
|
||||
found:
|
||||
if (early_acpihid_map_size == EARLY_MAP_SIZE) {
|
||||
pr_err("Early ACPI HID map overflow - ignoring ivrs_acpihid%s\n",
|
||||
str);
|
||||
return 1;
|
||||
}
|
||||
|
||||
p = acpiid;
|
||||
hid = strsep(&p, ":");
|
||||
uid = p;
|
||||
|
||||
Reference in New Issue
Block a user