summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/exfldio.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2011-11-30 09:35:05 +0800
committerLen Brown <len.brown@intel.com>2012-01-17 03:36:27 -0500
commitec4636669bf9c6ff157121ab42709650a9e0cc2a (patch)
tree41b10cf575dde3d9e83beae5b0511ac8d7531f31 /drivers/acpi/acpica/exfldio.c
parent46dfb09c024a1a92ead63b40f6993dcb5eb7d153 (diff)
ACPICA: Do not abort table load on invalid space ID
Ignore an invalid space ID during a table load. Instead, detect it if a control method attempts access - then abort the method. http://www.acpica.org/bugzilla/show_bug.cgi?id=925 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/exfldio.c')
-rw-r--r--drivers/acpi/acpica/exfldio.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 19df8ce66ee7..2a524fc1e851 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -86,6 +86,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
{
acpi_status status = AE_OK;
union acpi_operand_object *rgn_desc;
+ u8 space_id;
ACPI_FUNCTION_TRACE_U32(ex_setup_region, field_datum_byte_offset);
@@ -101,6 +102,17 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
+ space_id = rgn_desc->region.space_id;
+
+ /* Validate the Space ID */
+
+ if (!acpi_is_valid_space_id(space_id)) {
+ ACPI_ERROR((AE_INFO,
+ "Invalid/unknown Address Space ID: 0x%2.2X",
+ space_id));
+ return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
+ }
+
/*
* If the Region Address and Length have not been previously evaluated,
* evaluate them now and save the results.
@@ -122,8 +134,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
* Exit now for SMBus or IPMI address space, it has a non-linear
* address space and the request cannot be directly validated
*/
- if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS ||
- rgn_desc->region.space_id == ACPI_ADR_SPACE_IPMI) {
+ if (space_id == ACPI_ADR_SPACE_SMBUS ||
+ space_id == ACPI_ADR_SPACE_IPMI) {
/* SMBus or IPMI has a non-linear address space */