Module Name: src
Committed By: jruoho
Date: Wed Aug 11 13:03:00 UTC 2010
Modified Files:
src/sys/dev/acpi: acpi_cpu_pstate.c
Log Message:
Add a small additional check for the validity of the GAS register.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/acpi/acpi_cpu_pstate.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/acpi/acpi_cpu_pstate.c
diff -u src/sys/dev/acpi/acpi_cpu_pstate.c:1.9 src/sys/dev/acpi/acpi_cpu_pstate.c:1.10
--- src/sys/dev/acpi/acpi_cpu_pstate.c:1.9 Wed Aug 11 11:48:21 2010
+++ src/sys/dev/acpi/acpi_cpu_pstate.c Wed Aug 11 13:02:59 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.9 2010/08/11 11:48:21 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.10 2010/08/11 13:02:59 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <[email protected]>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.9 2010/08/11 11:48:21 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.10 2010/08/11 13:02:59 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -426,6 +426,11 @@
width = reg[i]->reg_bitwidth;
+ if (width + reg[i]->reg_bitoffset > 32) {
+ rv = AE_AML_BAD_RESOURCE_VALUE;
+ goto out;
+ }
+
if (width != 8 && width != 16 && width != 32) {
rv = AE_AML_BAD_RESOURCE_VALUE;
goto out;