diff options
author | Bob Moore <robert.moore@intel.com> | 2013-08-08 03:29:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-11-29 14:11:40 -0500 |
commit | 97020dadef81be7b3f1af758406a97d02c1cfa6b (patch) | |
tree | 96fe5db84353a655d3bfd717e2337056ba7f1b8c | |
parent | 0417642d6541b4583cdebbb031f8c020029400e7 (diff) |
ACPICA: Return error if DerefOf resolves to a null package element.
commit a50abf4842dd7d603a2ad6dcc7f1467fd2a66f03 upstream.
Disallow the dereference of a reference (via index) to an uninitialized
package element. Provides compatibility with other ACPI
implementations. ACPICA BZ 1003.
References: https://bugs.acpica.org/show_bug.cgi?id=431
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/acpi/acpica/exoparg1.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c index eaa0fcd9644b..c3241b188434 100644 --- a/drivers/acpi/acpica/exoparg1.c +++ b/drivers/acpi/acpica/exoparg1.c | |||
@@ -963,10 +963,17 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
963 | */ | 963 | */ |
964 | return_desc = | 964 | return_desc = |
965 | *(operand[0]->reference.where); | 965 | *(operand[0]->reference.where); |
966 | if (return_desc) { | 966 | if (!return_desc) { |
967 | acpi_ut_add_reference | 967 | /* |
968 | (return_desc); | 968 | * Element is NULL, do not allow the dereference. |
969 | * This provides compatibility with other ACPI | ||
970 | * implementations. | ||
971 | */ | ||
972 | return_ACPI_STATUS | ||
973 | (AE_AML_UNINITIALIZED_ELEMENT); | ||
969 | } | 974 | } |
975 | |||
976 | acpi_ut_add_reference(return_desc); | ||
970 | break; | 977 | break; |
971 | 978 | ||
972 | default: | 979 | default: |