lkml.org 
[lkml]   [2015]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC Patch 12/19] ACPI: Enforce stricter checks for address space descriptors
Date
Enforce stricter checks for address space descriptors according to
ACPI spec.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/acpi/resource.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 26b47f1da523..e82149e44347 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -192,6 +192,14 @@ static bool acpi_decode_space(struct resource *res,
bool wp = base->info.mem.write_protect;
u64 len = addr->address_length;

+ /*
+ * Filter out invalid descriptor according to ACPI Spec 5.0, section
+ * 6.4.3.5 Address Space Resource Descriptors.
+ */
+ if ((base->min_address_fixed != base->max_address_fixed && len) ||
+ (base->min_address_fixed && base->max_address_fixed && !len))
+ return false;
+
res->start = addr->minimum;
res->end = addr->maximum;

--
1.7.10.4


\
 
 \ /
  Last update: 2015-01-08 03:41    [W:0.232 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site