[PATCH] acpi: acpidump: abort dumping of SLIC if length is zero

Colin King colin.king at canonical.com
Mon Mar 18 15:32:55 UTC 2013


From: Colin Ian King <colin.king at canonical.com>

Some systems have a length specified as zero in the SLIC header
length field which means we get stuck dumping the null headers
forever.  Add a check so we can break out early.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/acpidump/acpidump.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index 5f3e25e..ecb6592 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -1452,6 +1452,17 @@ static void acpidump_slic(fwts_framework *fw, fwts_acpi_table_info *table)
 		fwts_acpi_table_slic_header *header =
 			(fwts_acpi_table_slic_header *)ptr;
 
+		/*
+		 *  Some machines such as the Acer Veritas have a SLIC header that
+		 *  declares it's length as zero.  So to avoid spinning forever
+		 *  break out of the loop.
+		 */
+		if ((ptr + sizeof(fwts_acpi_table_slic_header) < data + length) &&
+		    (header->length == 0)) {
+			fwts_log_info(fw, "SLIC header length is zero, aborting dump of SLIC.");
+			break;
+		}
+
 		switch(header->type) {
 		case 0:
 			__acpi_dump_table_fields(fw, ptr, slic_header_fields, ptr - data);
-- 
1.8.1.2




More information about the fwts-devel mailing list