diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2019-10-10 04:09:05 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2019-10-10 04:09:05 +0000 |
commit | 73a75e02dc76e8cd98493ed9b67797a3c66e4176 (patch) | |
tree | 35bd87b3cfe13a0e6791a8224fc47b40fae1d8fc /sys/dev/acpi | |
parent | 15ee9292ec595693feda989c07a0e52ee118dd38 (diff) |
Make reading past the end of an AML array not a panic.
Several machines have broken AML which reads past the end the end
of an array. Previously this was an aml_die/panic. acpica just warns
on such accesses, so this diff makes us do the same.
ok kettenis, jcs, deraadt
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/dsdt.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 979b4c1c7e4..a8f6210f3ab 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.247 2019/10/10 04:04:33 mlarkin Exp $ */ +/* $OpenBSD: dsdt.c,v 1.248 2019/10/10 04:09:04 mlarkin Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -4037,13 +4037,9 @@ aml_parse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_INDEX: /* Index: tir => ObjRef */ idx = opargs[1]->v_integer; - if (idx >= opargs[0]->length || idx < 0) { -#ifndef SMALL_KERNEL - aml_showvalue(opargs[0]); -#endif - aml_die("Index out of bounds %d/%d\n", idx, - opargs[0]->length); - } + /* Reading past the end of the array? - Ignore */ + if (idx >= opargs[0]->length || idx < 0) + break; switch (opargs[0]->type) { case AML_OBJTYPE_PACKAGE: /* Don't set opargs[0] to NULL */ |