Skip to content

Commit 85c410f

Browse files
nkiryushingregkh
authored andcommitted
ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields()
[ Upstream commit 40e2710 ] ACPICA commit 9061cd9aa131205657c811a52a9f8325a040c6c9 Errors in acpi_evaluate_object() can lead to incorrect state of buffer. This can lead to access to data in previously ACPI_FREEd buffer and secondary ACPI_FREE to the same buffer later. Handle errors in acpi_evaluate_object the same way it is done earlier with acpi_ns_handle_to_pathname. Found by Linux Verification Center (linuxtesting.org) with SVACE. Link: acpica/acpica@9061cd9a Fixes: 5fd0332 ("ACPICA: debugger: add command to dump all fields of particular subtype") Signed-off-by: Nikita Kiryushin <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2e43d8e commit 85c410f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/acpi/acpica/dbnames.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,12 @@ acpi_db_walk_for_fields(acpi_handle obj_handle,
550550
ACPI_FREE(buffer.pointer);
551551

552552
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
553-
acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
554-
553+
status = acpi_evaluate_object(obj_handle, NULL, NULL, &buffer);
554+
if (ACPI_FAILURE(status)) {
555+
acpi_os_printf("Could Not evaluate object %p\n",
556+
obj_handle);
557+
return (AE_OK);
558+
}
555559
/*
556560
* Since this is a field unit, surround the output in braces
557561
*/

0 commit comments

Comments
 (0)