commit acpica for openSUSE:Factory
Hello community, here is the log from the commit of package acpica for openSUSE:Factory checked in at 2019-05-25 13:19:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/acpica (Old) and /work/SRC/openSUSE:Factory/.acpica.new.5148 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "acpica" Sat May 25 13:19:14 2019 rev:59 rq:704812 version:20190509 Changes: -------- --- /work/SRC/openSUSE:Factory/acpica/acpica.changes 2019-04-12 09:11:05.225586137 +0200 +++ /work/SRC/openSUSE:Factory/.acpica.new.5148/acpica.changes 2019-05-25 13:19:19.144356993 +0200 @@ -1,0 +2,7 @@ +Wed May 22 09:29:13 UTC 2019 - trenn@suse.de + +- Update to version 20190509 + Includes a fix that breaks VirtualBox + https://github.com/acpica/acpica/issues/462 + +------------------------------------------------------------------- Old: ---- acpica-unix-20190405.tar.gz New: ---- acpica-unix-20190509.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ acpica.spec ++++++ --- /var/tmp/diff_new_pack.fHGpE1/_old 2019-05-25 13:19:20.840356362 +0200 +++ /var/tmp/diff_new_pack.fHGpE1/_new 2019-05-25 13:19:20.840356362 +0200 @@ -20,7 +20,7 @@ %define kver %(rpm -q --qf '%%{VERSION}' kernel-source) %define dmp_ver %{kver} Name: acpica -Version: 20190405 +Version: 20190509 Release: 0 Summary: This is a set of tools to display and debug your BIOS ACPI tables License: GPL-2.0-only ++++++ acpica-unix-20190405.tar.gz -> acpica-unix-20190509.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/changes.txt new/acpica-unix-20190509/changes.txt --- old/acpica-unix-20190405/changes.txt 2019-04-05 17:12:57.000000000 +0200 +++ new/acpica-unix-20190509/changes.txt 2019-05-10 00:04:14.000000000 +0200 @@ -1,4 +1,91 @@ ---------------------------------------- +09 May 2019. Summary of changes for version 20190509: + + +1) ACPICA kernel-resident subsystem: + +Revert commit 6c43e1a ("ACPICA: Clear status of GPEs before enabling +them") that causes problems with Thunderbolt controllers to occur if a +dock device is connected at init time (the xhci_hcd and thunderbolt +modules crash which prevents peripherals connected through them from +working). Commit 6c43e1a effectively causes commit ecc1165b8b74 ("ACPICA: +Dispatch active GPEs at init time") to get undone, so the problem +addressed by commit ecc1165b8b74 appears again as a result of it. + + +2) iASL Compiler/Disassembler and ACPICA tools: + +Reverted iASL: Additional forward reference detection. This change +reverts forward reference detection for field declarations. The feature +unintentionally emitted AML bytecode with incorrect package lengths for +some ASL code related to Fields and OperationRegions. This malformed AML +can cause systems to crash +during boot. The malformed AML bytecode is emitted in iASL version +20190329 and 20190405. + +iASL: improve forward reference detection. This change improves forward +reference detection for named objects inside of scopes. If a parse object +has the OP_NOT_FOUND_DURING_LOAD set, it means that Op is a reference to +a named object that is declared later in the AML bytecode. This is +allowed if the reference is inside of a method and the declaration is +outside of a method like so: + +DefinitionBlock(...) +{ + Method (TEST) + { + Return (NUM0) + } + Name (NUM0,0) +} + +However, if the declaration and reference are both in the same method or +outside any methods, this is a forward reference and should be marked as +an error because it would result in runtime errors. + +DefinitionBlock(...) +{ + Name (BUFF, Buffer (NUM0) {}) // Forward reference + Name (NUM0, 0x0) + + Method (TEST) + { + Local0 = NUM1 + Name (NUM1, 0x1) // Forward reference + return (Local0) + } +} + +iASL: Implemented additional buffer overflow analysis for BufferField +declarations. Check if a buffer index argument to a create buffer field +operation is beyond the end of the target buffer. + +This affects these AML operators: + + AML_CREATE_FIELD_OP + AML_CREATE_BIT_FIELD_OP + AML_CREATE_BYTE_FIELD_OP + AML_CREATE_WORD_FIELD_OP + AML_CREATE_DWORD_FIELD_OP + AML_CREATE_QWORD_FIELD_OP + + There are three conditions that must be satisfied in order to allow this +validation at compile time: + + 1) The length of the target buffer must be an integer constant + 2) The index specified in the create* must be an integer constant + 3) For CreateField, the bit length argument must be non-zero. + +Example: + Name (BUF1, Buffer() {1,2}) + CreateField (BUF1, 7, 9, CF03) // 3: ERR + +dsdt.asl 14: CreateField (BUF1, 7, 9, CF03) // 3: ERR +Error 6165 - ^ Buffer index beyond end of +target buffer + + +---------------------------------------- 05 April 2019. Summary of changes for version 20190405: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslcodegen.c new/acpica-unix-20190509/source/compiler/aslcodegen.c --- old/acpica-unix-20190405/source/compiler/aslcodegen.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslcodegen.c 2019-05-10 00:04:15.000000000 +0200 @@ -690,7 +690,8 @@ { if (FlReadFile (ASL_FILE_AML_OUTPUT, &FileByte, 1) != AE_OK) { - printf ("EOF while reading checksum bytes\n"); + AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, NULL, + "Table length is greater than size of the input file"); return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslcompile.c new/acpica-unix-20190509/source/compiler/aslcompile.c --- old/acpica-unix-20190405/source/compiler/aslcompile.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslcompile.c 2019-05-10 00:04:15.000000000 +0200 @@ -224,7 +224,6 @@ if (AslGbl_PreprocessOnly) { UtEndEvent (Event); - CmCleanupAndExit (); return (AE_OK); } } @@ -919,7 +918,7 @@ * We will delete the AML file if there are errors and the * force AML output option has not been used. */ - if (AslGbl_ParserErrorDetected || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && + if (AslGbl_ParserErrorDetected || AslGbl_PreprocessOnly || ((AslGbl_ExceptionCount[ASL_ERROR] > 0) && (!AslGbl_IgnoreErrors) && AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslcompiler.h new/acpica-unix-20190509/source/compiler/aslcompiler.h --- old/acpica-unix-20190405/source/compiler/aslcompiler.h 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslcompiler.h 2019-05-10 00:04:15.000000000 +0200 @@ -1105,10 +1105,6 @@ FlGetCurrentFileNode ( void); -BOOLEAN -FlInputFileExists ( - char *InputFilename); - /* * aslhwmap - hardware map summary diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslerror.c new/acpica-unix-20190509/source/compiler/aslerror.c --- old/acpica-unix-20190405/source/compiler/aslerror.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslerror.c 2019-05-10 00:04:15.000000000 +0200 @@ -869,16 +869,8 @@ return; } - if (!FlInputFileExists (Filename)) - { - /* - * This means that this file is an include file. Record the .src - * file as the error message source because this file is not in - * the global file list. - */ - Enode->SourceFilename = - FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; - } + Enode->SourceFilename = + FileNode->Files[ASL_FILE_SOURCE_OUTPUT].Filename; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslfiles.c new/acpica-unix-20190509/source/compiler/aslfiles.c --- old/acpica-unix-20190405/source/compiler/aslfiles.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslfiles.c 2019-05-10 00:04:15.000000000 +0200 @@ -163,6 +163,10 @@ ACPI_PARSE_OBJECT *Op, char *Filename); +static BOOLEAN +FlInputFileExists ( + char *InputFilename); + #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_STATUS FlParseInputPathname ( @@ -250,7 +254,7 @@ * ******************************************************************************/ -BOOLEAN +static BOOLEAN FlInputFileExists ( char *Filename) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslload.c new/acpica-unix-20190509/source/compiler/aslload.c --- old/acpica-unix-20190405/source/compiler/aslload.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslload.c 2019-05-10 00:04:15.000000000 +0200 @@ -263,10 +263,29 @@ ACPI_WALK_STATE *WalkState) { ACPI_PARSE_OBJECT *Child = NULL; + ACPI_PARSE_OBJECT *SourceRegion; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; + + SourceRegion = UtGetArg (Op, 0); + if (SourceRegion) + { + Status = AcpiNsLookup (WalkState->ScopeInfo, + SourceRegion->Asl.Value.String, + ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, + ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); + if (Status == AE_NOT_FOUND) + { + /* + * If the named object is not found, it means that it is either a + * forward reference or the named object does not exist. + */ + SourceRegion->Asl.CompileFlags |= OP_NOT_FOUND_DURING_LOAD; + } + } + /* Get the first named field element */ switch (Op->Asl.AmlOpcode) @@ -493,7 +512,7 @@ case AML_FIELD_OP: Status = LdLoadFieldElements (Op, WalkState); - break; + return (Status); case AML_INT_CONNECTION_OP: @@ -557,8 +576,7 @@ * We only want references to named objects: * Store (2, WXYZ) -> Attempt to resolve the name */ - if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && - (OpInfo->Type != AML_TYPE_NAMED_FIELD)) + if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) { return (AE_OK); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslmain.c new/acpica-unix-20190509/source/compiler/aslmain.c --- old/acpica-unix-20190405/source/compiler/aslmain.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslmain.c 2019-05-10 00:04:15.000000000 +0200 @@ -291,7 +291,8 @@ /* * At this point, compilation of a data table or disassembly is complete. */ - if (AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA || AcpiGbl_DisasmFlag) + if (AslGbl_PreprocessOnly || AcpiGbl_DisasmFlag || + AslGbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) { goto CleanupAndExit; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslmessages.c new/acpica-unix-20190509/source/compiler/aslmessages.c --- old/acpica-unix-20190405/source/compiler/aslmessages.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslmessages.c 2019-05-10 00:04:15.000000000 +0200 @@ -283,7 +283,7 @@ /* ASL_MSG_NO_RETVAL */ "Called method returns no value", /* ASL_MSG_NO_WHILE */ "No enclosing While statement", /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", -/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", +/* ASL_MSG_BUFFER_FIELD_LENGTH */ "Field length must be non-zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", /* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", @@ -342,7 +342,7 @@ /* ASL_MSG_RANGE */ "Constant out of range", /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", -/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Forward references are not supported by the ASL language", +/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference", /* ASL_MSG_ILLEGAL_METHOD_REF */ "Object is declared in a different method", /* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", /* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", @@ -364,7 +364,8 @@ /* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist", /* ASL_MSG_REGION_LENGTH */ "Operation Region declared with zero length", /* ASL_MSG_TEMPORARY_OBJECT */ "Object is created temporarily in another method and cannot be accessed", -/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist" +/* ASL_MSG_UNDEFINED_EXTERNAL */ "Named object was declared external but the actual definition does not exist", +/* ASL_MSG_BUFFER_FIELD_OVERFLOW */ "Buffer field extends beyond end of target buffer" }; /* Table compiler */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslmessages.h new/acpica-unix-20190509/source/compiler/aslmessages.h --- old/acpica-unix-20190405/source/compiler/aslmessages.h 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslmessages.h 2019-05-10 00:04:15.000000000 +0200 @@ -285,7 +285,7 @@ ASL_MSG_NO_RETVAL, ASL_MSG_NO_WHILE, ASL_MSG_NON_ASCII, - ASL_MSG_NON_ZERO, + ASL_MSG_BUFFER_FIELD_LENGTH, ASL_MSG_NOT_EXIST, ASL_MSG_NOT_FOUND, ASL_MSG_NOT_METHOD, @@ -367,6 +367,7 @@ ASL_MSG_REGION_LENGTH, ASL_MSG_TEMPORARY_OBJECT, ASL_MSG_UNDEFINED_EXTERNAL, + ASL_MSG_BUFFER_FIELD_OVERFLOW, /* These messages are used by the Data Table compiler only */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/asloperands.c new/acpica-unix-20190509/source/compiler/asloperands.c --- old/acpica-unix-20190405/source/compiler/asloperands.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/asloperands.c 2019-05-10 00:04:15.000000000 +0200 @@ -819,6 +819,7 @@ BufferLengthOp->Asl.Value.Integer = BufferLength; (void) OpcSetOptimalIntegerSize (BufferLengthOp); + UtSetParseOpName (BufferLengthOp); /* Remaining nodes are handled via the tree walk */ } @@ -905,6 +906,7 @@ */ Op->Asl.Child->Asl.ParseOpcode = PARSEOP_INTEGER; Op->Asl.Child->Asl.Value.Integer = PackageLength; + UtSetParseOpName (Op); /* Set the AML opcode */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslstartup.c new/acpica-unix-20190509/source/compiler/aslstartup.c --- old/acpica-unix-20190405/source/compiler/aslstartup.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslstartup.c 2019-05-10 00:04:15.000000000 +0200 @@ -550,14 +550,10 @@ Status = CmDoCompile (); if (ACPI_FAILURE (Status)) { + PrTerminatePreprocessor (); return (Status); } - /* Cleanup (for next source file) and exit */ - - AeClearErrorLog (); - PrTerminatePreprocessor (); - /* * At this point, we know how many lines are in the input file. Save it * to display for post-compilation summary. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslutils.c new/acpica-unix-20190509/source/compiler/aslutils.c --- old/acpica-unix-20190405/source/compiler/aslutils.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslutils.c 2019-05-10 00:04:15.000000000 +0200 @@ -541,8 +541,14 @@ { UINT32 i; ASL_GLOBAL_FILE_NODE *FileNode; + BOOLEAN DisplayAMLSummary; + DisplayAMLSummary = + !AslGbl_PreprocessOnly && !AslGbl_ParserErrorDetected && + ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || AslGbl_IgnoreErrors) && + AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle; + if (FileId != ASL_FILE_STDOUT) { /* Compiler name and version number */ @@ -595,9 +601,7 @@ /* AML summary */ - if (!AslGbl_ParserErrorDetected && - ((AslGbl_ExceptionCount[ASL_ERROR] == 0) || AslGbl_IgnoreErrors) && - AslGbl_Files[ASL_FILE_AML_OUTPUT].Handle) + if (DisplayAMLSummary) { FlPrintFile (FileId, "%-14s %s - %7u bytes %6u opcodes %6u named objects\n", @@ -633,7 +637,7 @@ continue; } - FlPrintFile (FileId, "%14s %s - %u bytes\n", + FlPrintFile (FileId, "%-14s %s - %7u bytes\n", AslGbl_FileDescs[i].ShortDescription, AslGbl_Files[i].Filename, FlGetFileSize (i)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslwalks.c new/acpica-unix-20190509/source/compiler/aslwalks.c --- old/acpica-unix-20190405/source/compiler/aslwalks.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslwalks.c 2019-05-10 00:04:15.000000000 +0200 @@ -165,6 +165,14 @@ AnAnalyzeStoreOperator ( ACPI_PARSE_OBJECT *Op); +static BOOLEAN +AnIsValidBufferConstant ( + ACPI_PARSE_OBJECT *Op); + +static void +AnValidateCreateBufferField ( + ACPI_PARSE_OBJECT *CreateBufferFieldOp); + /******************************************************************************* * @@ -669,6 +677,14 @@ OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + if (OpInfo->Flags & AML_CREATE) + { + /* This group contains all of the Create Buffer Field operators */ + + AnValidateCreateBufferField (Op); + return (AE_OK); + } + /* * Determine if an execution class operator actually does something by * checking if it has a target and/or the function return value is used. @@ -734,10 +750,10 @@ } } - /* * Semantic checks for individual ASL operators */ + switch (Op->Asl.ParseOpcode) { case PARSEOP_STORE: @@ -785,22 +801,6 @@ } break; - case PARSEOP_CREATEFIELD: - /* - * Check for a zero Length (NumBits) operand. NumBits is the 3rd operand - */ - ArgOp = Op->Asl.Child; - ArgOp = ArgOp->Asl.Next; - ArgOp = ArgOp->Asl.Next; - - if ((ArgOp->Asl.ParseOpcode == PARSEOP_ZERO) || - ((ArgOp->Asl.ParseOpcode == PARSEOP_INTEGER) && - (ArgOp->Asl.Value.Integer == 0))) - { - AslError (ASL_ERROR, ASL_MSG_NON_ZERO, ArgOp, NULL); - } - break; - case PARSEOP_CONNECTION: /* * Ensure that the referenced operation region has the correct SPACE_ID. @@ -886,6 +886,194 @@ } +/******************************************************************************* + * + * FUNCTION: AnValidateCreateBufferField + * + * PARAMETERS: Op - A create buffer field operator + * + * RETURN: None + * + * DESCRIPTION: Check if a buffer index argument to a create buffer field + * operation is beyond the end of the target buffer. + * + * Validates these AML operators: + * + * AML_CREATE_FIELD_OP + * AML_CREATE_BIT_FIELD_OP + * AML_CREATE_BYTE_FIELD_OP + * AML_CREATE_WORD_FIELD_OP + * AML_CREATE_DWORD_FIELD_OP + * AML_CREATE_QWORD_FIELD_OP + * + * There are two conditions that must be satisfied in order to enable + * validation at compile time: + * + * 1) The length of the target buffer must be an integer constant + * 2) The index specified in the create* must be an integer constant + * 3) For CreateField, the bit length argument must be non-zero. + * + ******************************************************************************/ + +static void +AnValidateCreateBufferField ( + ACPI_PARSE_OBJECT *CreateBufferFieldOp) +{ + ACPI_PARSE_OBJECT *TargetBufferOp; + ACPI_PARSE_OBJECT *ArgOp; + UINT32 TargetBufferLength; + UINT32 LastFieldByteIndex; + + + /* + * 1) Get the length of the target buffer + */ + ArgOp = CreateBufferFieldOp->Asl.Child; /* Reference to target buffer */ + + /* + * If no attached Node, the target buffer may be something like an + * ArgX or LocalX and cannot be evaluated at compile time. + */ + if (!ArgOp->Asl.Node) + { + return; + } + + TargetBufferOp = ArgOp->Asl.Node->Op; + TargetBufferOp = TargetBufferOp->Asl.Child; /* Target buffer */ + TargetBufferOp = TargetBufferOp->Asl.Next; /* "Buffer" keyword */ + if (!TargetBufferOp) + { + /* Not a statement of the form NAME(XXXX, Buffer.... */ + + return; + } + + /* Get the buffer length argument. It must be an integer constant */ + + ArgOp = TargetBufferOp->Asl.Child; + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + TargetBufferLength = (UINT32) ArgOp->Asl.Value.Integer; + + /* + * 2) Get the value of the buffer index argument. It must be + * an integer constant. + */ + ArgOp = CreateBufferFieldOp->Asl.Child; /* Reference to target buffer */ + ArgOp = ArgOp->Asl.Next; /* Buffer Index argument*/ + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + LastFieldByteIndex = + (UINT32) ArgOp->Asl.Value.Integer; /* Index can be in either bytes or bits */ + + /* + * 3) Get the length of the new buffer field, in bytes. Also, + * create the final target buffer index for the last byte of the field + */ + switch (CreateBufferFieldOp->Asl.ParseOpcode) + { + case PARSEOP_CREATEBITFIELD: /* A one bit field */ + + LastFieldByteIndex = ACPI_ROUND_BITS_DOWN_TO_BYTES (LastFieldByteIndex); + break; + + case PARSEOP_CREATEBYTEFIELD: + break; + + case PARSEOP_CREATEWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT16) - 1); + break; + + case PARSEOP_CREATEDWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT32) - 1); + break; + + case PARSEOP_CREATEQWORDFIELD: + + LastFieldByteIndex += (sizeof (UINT64) - 1); + break; + + case PARSEOP_CREATEFIELD: /* Multi-bit field */ + + ArgOp = ArgOp->Asl.Next; /* Length argument, in bits */ + if (!AnIsValidBufferConstant (ArgOp)) + { + return; + } + + /* The buffer field length is not allowed to be zero */ + + if (ArgOp->Asl.Value.Integer == 0) + { + AslError (ASL_WARNING, ASL_MSG_BUFFER_FIELD_LENGTH, ArgOp, NULL); + return; + } + + LastFieldByteIndex += + ((UINT32) ArgOp->Asl.Value.Integer - 1); /* Create final bit index */ + + /* Convert bit index to a byte index */ + + LastFieldByteIndex = ACPI_ROUND_BITS_DOWN_TO_BYTES (LastFieldByteIndex); + break; + + default: + return; + } + + /* + * 4) Check for an access (index) beyond the end of the target buffer, + * or a zero length target buffer. + */ + if (!TargetBufferLength || (LastFieldByteIndex >= TargetBufferLength)) + { + AslError (ASL_WARNING, ASL_MSG_BUFFER_FIELD_OVERFLOW, ArgOp, NULL); + } +} + + +/******************************************************************************* + * + * FUNCTION: AnIsValidBufferConstant + * + * PARAMETERS: Op - A buffer-related operand + * + * RETURN: TRUE if operand is valid constant, FALSE otherwise + * + * DESCRIPTION: Check if the input Op is valid constant that can be used + * in compile-time analysis. + * + ******************************************************************************/ + +static BOOLEAN +AnIsValidBufferConstant ( + ACPI_PARSE_OBJECT *Op) +{ + if (!Op) + { + return (FALSE); + } + + if ((Op->Asl.ParseOpcode == PARSEOP_INTEGER) || + (Op->Asl.ParseOpcode == PARSEOP_ZERO) || + (Op->Asl.ParseOpcode == PARSEOP_ONE)) + { + return (TRUE); + } + + return (FALSE); +} + + /******************************************************************************* * * FUNCTION: AnAnalyzeStoreOperator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/compiler/aslxref.c new/acpica-unix-20190509/source/compiler/aslxref.c --- old/acpica-unix-20190405/source/compiler/aslxref.c 2019-04-05 17:12:58.000000000 +0200 +++ new/acpica-unix-20190509/source/compiler/aslxref.c 2019-05-10 00:04:15.000000000 +0200 @@ -460,6 +460,8 @@ ASL_METHOD_LOCAL *MethodArgs = NULL; int RegisterNumber; UINT32 i; + ACPI_NAMESPACE_NODE *DeclarationParentMethod; + ACPI_PARSE_OBJECT *ReferenceParentMethod; ACPI_FUNCTION_TRACE_PTR (XfNamespaceLocateBegin, Op); @@ -613,8 +615,7 @@ (Op->Asl.ParseOpcode != PARSEOP_NAMESTRING) && (Op->Asl.ParseOpcode != PARSEOP_NAMESEG) && (Op->Asl.ParseOpcode != PARSEOP_METHODCALL) && - (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL) && - (OpInfo->Type != AML_TYPE_NAMED_FIELD)) + (Op->Asl.ParseOpcode != PARSEOP_EXTERNAL)) { return_ACPI_STATUS (AE_OK); } @@ -638,8 +639,7 @@ if ((Op->Asl.ParseOpcode == PARSEOP_NAMESTRING) || (Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || (Op->Asl.ParseOpcode == PARSEOP_METHODCALL) || - (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) || - (OpInfo->Type == AML_TYPE_NAMED_FIELD)) + (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) { /* * These are name references, do not push the scope stack @@ -676,10 +676,6 @@ Path = NextOp->Asl.Value.String; } - else if (OpInfo->Type == AML_TYPE_NAMED_FIELD) - { - Path = Op->Asl.Child->Asl.Value.String; - } else { Path = Op->Asl.Value.String; @@ -798,24 +794,45 @@ return_ACPI_STATUS (Status); } - /* Object was found above, check for an illegal forward reference */ + /* Object was found above, check for an illegal forward reference */ if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) { /* * During the load phase, this Op was flagged as a possible - * illegal forward reference + * illegal forward reference. In other words, Op is a name path or + * name segment that refers to a named object declared after the + * reference. In this scinario, Node refers to the actual declaration + * and Op is a parse node that references the named object. * - * Note: Allow "forward references" from within a method to an - * object that is not within any method (module-level code) + * Note: + * + * Object references inside of control methods are allowed to + * refer to objects declared outside of control methods. + * + * If the declaration and reference are both contained inside of the + * same method or outside of any method, this is a forward reference + * and should be reported as a compiler error. */ - if (!WalkState->ScopeInfo || (UtGetParentMethod (Node) && - !UtNodeIsDescendantOf (WalkState->ScopeInfo->Scope.Node, - UtGetParentMethod (Node)))) + DeclarationParentMethod = UtGetParentMethod (Node); + ReferenceParentMethod = XfGetParentMethod (Op); + + /* case 1: declaration and refrence are both outside of method */ + + if (!ReferenceParentMethod && !DeclarationParentMethod) { AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, Op->Asl.ExternalName); } + + /* case 2: declaration and reference are both inside of the same method */ + + else if (ReferenceParentMethod && DeclarationParentMethod && + ReferenceParentMethod == DeclarationParentMethod->Op) + { + AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, + Op->Asl.ExternalName); + } } /* Check for a reference vs. name declaration */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/components/events/evgpe.c new/acpica-unix-20190509/source/components/events/evgpe.c --- old/acpica-unix-20190405/source/components/events/evgpe.c 2019-04-05 17:12:59.000000000 +0200 +++ new/acpica-unix-20190509/source/components/events/evgpe.c 2019-05-10 00:04:16.000000000 +0200 @@ -240,14 +240,6 @@ ACPI_FUNCTION_TRACE (EvEnableGpe); - /* Clear the GPE (of stale events) */ - - Status = AcpiHwClearGpe(GpeEventInfo); - if (ACPI_FAILURE(Status)) - { - return_ACPI_STATUS(Status); - } - /* Enable the requested GPE */ Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/include/acpixf.h new/acpica-unix-20190509/source/include/acpixf.h --- old/acpica-unix-20190405/source/include/acpixf.h 2019-04-05 17:13:01.000000000 +0200 +++ new/acpica-unix-20190509/source/include/acpixf.h 2019-05-10 00:04:18.000000000 +0200 @@ -154,7 +154,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20190405 +#define ACPI_CA_VERSION 0x20190509 #include "acconfig.h" #include "actypes.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/acpica-unix-20190405/source/include/platform/aclinux.h new/acpica-unix-20190509/source/include/platform/aclinux.h --- old/acpica-unix-20190405/source/include/platform/aclinux.h 2019-04-05 17:13:01.000000000 +0200 +++ new/acpica-unix-20190509/source/include/platform/aclinux.h 2019-05-10 00:04:18.000000000 +0200 @@ -205,6 +205,11 @@ #define ACPI_INIT_FUNCTION __init +/* Use a specific bugging default separate from ACPICA */ + +#undef ACPI_DEBUG_DEFAULT +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) + #ifndef CONFIG_ACPI /* External globals for __KERNEL__, stubs is needed */ @@ -221,11 +226,6 @@ #define ACPI_NO_ERROR_MESSAGES #undef ACPI_DEBUG_OUTPUT -/* Use a specific bugging default separate from ACPICA */ - -#undef ACPI_DEBUG_DEFAULT -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) - /* External interface for __KERNEL__, stub is needed */ #define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
participants (1)
-
root