acpi: Check ACPI revision before accessing XSDT
This field is only present in revisions after zero, so add the missing check. This avoids a buffer overrun with a revision 1.0 ACPI table. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
@@ -81,7 +81,7 @@ static int setup_search(struct acpi_rsdt **rsdtp, struct acpi_xsdt **xsdtp)
|
||||
return -ENOENT;
|
||||
if (!acpi_valid_rsdp(rsdp))
|
||||
return -EINVAL;
|
||||
if (rsdp->xsdt_address) {
|
||||
if (rsdp->revision > 1 && rsdp->xsdt_address) {
|
||||
xsdt = nomap_sysmem(rsdp->xsdt_address, 0);
|
||||
len = xsdt->header.length - sizeof(xsdt->header);
|
||||
count = len / sizeof(u64);
|
||||
|
||||
Reference in New Issue
Block a user