Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/acpica/dist/dispatcher Fix out of range acc...



details:   https://anonhg.NetBSD.org/src/rev/ba4d31df51be
branches:  trunk
changeset: 370084:ba4d31df51be
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Sep 16 08:08:01 2022 +0000

description:
Fix out of range access in AcpiDsExecEndOp().

 - Found by kUBSan.
 - See: https://github.com/acpica/acpica/pull/745

diffstat:

 sys/external/bsd/acpica/dist/dispatcher/dswexec.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r 0fcad64db6ce -r ba4d31df51be sys/external/bsd/acpica/dist/dispatcher/dswexec.c
--- a/sys/external/bsd/acpica/dist/dispatcher/dswexec.c Fri Sep 16 07:55:34 2022 +0000
+++ b/sys/external/bsd/acpica/dist/dispatcher/dswexec.c Fri Sep 16 08:08:01 2022 +0000
@@ -461,9 +461,11 @@
 
         /*
          * All opcodes require operand resolution, with the only exceptions
-         * being the ObjectType and SizeOf operators.
+         * being the ObjectType and SizeOf operators as well as operands that
+        * take no arguments.
          */
-        if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE))
+        if (!(WalkState->OpInfo->Flags & AML_NO_OPERAND_RESOLVE) &&
+           (WalkState->OpInfo->Flags & AML_HAS_ARGS))
         {
             /* Resolve all operands */
 



Home | Main Index | Thread Index | Old Index