diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2021-12-09 20:21:36 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2021-12-09 20:21:36 +0000 |
commit | 781114e6be282314b727e35f50fd943ac9771e1d (patch) | |
tree | c6b460383d9bf642078598ece4cdc9832eb9e79b | |
parent | 7fc2f1f12eee3b4df680612116b24554bd753c76 (diff) |
Broken ACPI tables containing scopes that are larger than their outer shell
are caught by our ACPI parser. Unfortunately in such cases our reaction was
to start parsing AML somewhere outside our current scope. The intention was
to clamp down the inner scope to the maximum of the outer one. So, rectify it.
This issue has shown up in EDK2's QEMU SBSA target, where the SSDT table was
generated incorrectly. Surprisingly neither Linux nor ACPICA's iASL noticed
that the table was broken.
ok kettenis@ millert@
-rw-r--r-- | sys/dev/acpi/dsdt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 0791607b19d..1a5694c9e4b 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.263 2021/05/22 13:13:14 kettenis Exp $ */ +/* $OpenBSD: dsdt.c,v 1.264 2021/12/09 20:21:35 patrick Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -1423,7 +1423,7 @@ aml_parseend(struct aml_scope *scope) "Bad scope... runover pos:%.4x new end:%.4x scope " "end:%.4x\n", aml_pc(pos), aml_pc(pos+len), aml_pc(scope->end)); - pos = scope->end; + return scope->end; } return pos+len; } |