Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Aug 2017 18:14:24 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r322467 - stable/11/usr.sbin/acpi/acpidump
Message-ID:  <201708131814.v7DIEOtG098743@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Sun Aug 13 18:14:24 2017
New Revision: 322467
URL: https://svnweb.freebsd.org/changeset/base/322467

Log:
  MFC r320736: acpidump: warn and exit loop on invalid subtable length
  
  Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/11/usr.sbin/acpi/acpidump/acpi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/acpi/acpidump/acpi.c
==============================================================================
--- stable/11/usr.sbin/acpi/acpidump/acpi.c	Sun Aug 13 18:12:56 2017	(r322466)
+++ stable/11/usr.sbin/acpi/acpidump/acpi.c	Sun Aug 13 18:14:24 2017	(r322467)
@@ -275,6 +275,10 @@ acpi_walk_subtables(ACPI_TABLE_HEADER *table, void *fi
 	end = (char *)table + table->Length;
 	while ((char *)subtable < end) {
 		printf("\n");
+		if (subtable->Length < sizeof(ACPI_SUBTABLE_HEADER)) {
+			warnx("invalid subtable length %u", subtable->Length);
+			return;
+		}
 		action(subtable);
 		subtable = (ACPI_SUBTABLE_HEADER *)((char *)subtable +
 		    subtable->Length);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708131814.v7DIEOtG098743>