Skip to content

Commit

Permalink
ACPI: Enforce stricter checks for address space descriptors
Browse files Browse the repository at this point in the history
Enforce stricter checks for address space descriptors according to
ACPI spec.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Jiang Liu authored and Rafael J. Wysocki committed Feb 3, 2015
1 parent c78b688 commit a274019
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/acpi/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ static bool acpi_decode_space(struct resource *res,
bool wp = addr->info.mem.write_protect;
u64 len = attr->address_length;

/*
* Filter out invalid descriptor according to ACPI Spec 5.0, section
* 6.4.3.5 Address Space Resource Descriptors.
*/
if ((addr->min_address_fixed != addr->max_address_fixed && len) ||
(addr->min_address_fixed && addr->max_address_fixed && !len))
pr_debug("ACPI: Invalid address space min_addr_fix %d, max_addr_fix %d, len %llx\n",
addr->min_address_fixed, addr->max_address_fixed, len);

res->start = attr->minimum;
res->end = attr->maximum;

Expand Down

0 comments on commit a274019

Please sign in to comment.