Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Add a small additional check for the validity o...



details:   https://anonhg.NetBSD.org/src/rev/fbdc564a9064
branches:  trunk
changeset: 757040:fbdc564a9064
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Aug 11 13:02:59 2010 +0000

description:
Add a small additional check for the validity of the GAS register.

diffstat:

 sys/dev/acpi/acpi_cpu_pstate.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 26e78e00b5b3 -r fbdc564a9064 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c    Wed Aug 11 12:41:09 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c    Wed Aug 11 13:02:59 2010 +0000
@@ -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 <jruohonen%iki.fi@localhost>
@@ -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;



Home | Main Index | Thread Index | Old Index