Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/acpitools/acpidump Check DSDT signature in acpi_han...
details: https://anonhg.NetBSD.org/src/rev/4463b51ee956
branches: trunk
changeset: 355864:4463b51ee956
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Aug 18 09:49:24 2017 +0000
description:
Check DSDT signature in acpi_handle_fadt() for broken ACPI table.
diffstat:
usr.sbin/acpitools/acpidump/acpi.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 0a82114ebb35 -r 4463b51ee956 usr.sbin/acpitools/acpidump/acpi.c
--- a/usr.sbin/acpitools/acpidump/acpi.c Fri Aug 18 04:07:51 2017 +0000
+++ b/usr.sbin/acpitools/acpidump/acpi.c Fri Aug 18 09:49:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.16 2017/08/04 06:30:36 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.17 2017/08/18 09:49:24 msaitoh Exp $ */
/*-
* Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: acpi.c,v 1.16 2017/08/04 06:30:36 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.17 2017/08/18 09:49:24 msaitoh Exp $");
#include <sys/param.h>
#include <sys/endian.h>
@@ -775,6 +775,8 @@
dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->Dsdt);
else
dsdp = (ACPI_TABLE_HEADER *)acpi_map_sdt(fadt->XDsdt);
+ if (memcmp(dsdp->Signature, ACPI_SIG_DSDT, 4) != 0)
+ errx(EXIT_FAILURE, "DSDT signature mismatch");
if (acpi_checksum(dsdp, dsdp->Length))
errx(EXIT_FAILURE, "DSDT is corrupt");
acpi_print_dsdt(dsdp);
Home |
Main Index |
Thread Index |
Old Index