diff options
author | Bob Moore <robert.moore@intel.com> | 2011-11-29 20:35:05 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-01-17 03:36:27 -0500 |
commit | ec4636669bf9c6ff157121ab42709650a9e0cc2a (patch) | |
tree | 41b10cf575dde3d9e83beae5b0511ac8d7531f31 /drivers/acpi/acpica/exfldio.c | |
parent | 46dfb09c024a1a92ead63b40f6993dcb5eb7d153 (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.c | 16 |
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, | |||
86 | { | 86 | { |
87 | acpi_status status = AE_OK; | 87 | acpi_status status = AE_OK; |
88 | union acpi_operand_object *rgn_desc; | 88 | union acpi_operand_object *rgn_desc; |
89 | u8 space_id; | ||
89 | 90 | ||
90 | ACPI_FUNCTION_TRACE_U32(ex_setup_region, field_datum_byte_offset); | 91 | ACPI_FUNCTION_TRACE_U32(ex_setup_region, field_datum_byte_offset); |
91 | 92 | ||
@@ -101,6 +102,17 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
101 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); | 102 | return_ACPI_STATUS(AE_AML_OPERAND_TYPE); |
102 | } | 103 | } |
103 | 104 | ||
105 | space_id = rgn_desc->region.space_id; | ||
106 | |||
107 | /* Validate the Space ID */ | ||
108 | |||
109 | if (!acpi_is_valid_space_id(space_id)) { | ||
110 | ACPI_ERROR((AE_INFO, | ||
111 | "Invalid/unknown Address Space ID: 0x%2.2X", | ||
112 | space_id)); | ||
113 | return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID); | ||
114 | } | ||
115 | |||
104 | /* | 116 | /* |
105 | * If the Region Address and Length have not been previously evaluated, | 117 | * If the Region Address and Length have not been previously evaluated, |
106 | * evaluate them now and save the results. | 118 | * evaluate them now and save the results. |
@@ -122,8 +134,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, | |||
122 | * Exit now for SMBus or IPMI address space, it has a non-linear | 134 | * Exit now for SMBus or IPMI address space, it has a non-linear |
123 | * address space and the request cannot be directly validated | 135 | * address space and the request cannot be directly validated |
124 | */ | 136 | */ |
125 | if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS || | 137 | if (space_id == ACPI_ADR_SPACE_SMBUS || |
126 | rgn_desc->region.space_id == ACPI_ADR_SPACE_IPMI) { | 138 | space_id == ACPI_ADR_SPACE_IPMI) { |
127 | 139 | ||
128 | /* SMBus or IPMI has a non-linear address space */ | 140 | /* SMBus or IPMI has a non-linear address space */ |
129 | 141 | ||