Skip to content

Commit

Permalink
Tables: Do not validate signature for dynamic table load
Browse files Browse the repository at this point in the history
Windows seems to allow arbitrary table signatures for Load/LoadTable
opcodes:
  ACPI BIOS Error (bug): Table has invalid signature [PRAD] (0x44415250)
So this patch removes dynamic load signature checks. However we need to
find a way to avoid table loading against tables like MADT. This is not
covered by this commit.

This Windows behavior has been validated on link #1. An end user bug
report can also be found on link #2.

This patch also includes simple cleanup for static load signature check
code. Reported by Ye Xiaolong, Fixed by Lv Zheng.

Link: #121 [#1]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=118601 [#2]
Reported-by: Ye Xiaolong <xiaolong.ye@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
  • Loading branch information
Lv Zheng committed Jun 26, 2017
1 parent 4551f51 commit d3c944f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
26 changes: 0 additions & 26 deletions source/components/tables/tbinstal.c
Expand Up @@ -351,32 +351,6 @@ AcpiTbInstallStandardTable (

if (Reload)
{
/*
* Validate the incoming table signature.
*
* 1) Originally, we checked the table signature for "SSDT" or "PSDT".
* 2) We added support for OEMx tables, signature "OEM".
* 3) Valid tables were encountered with a null signature, so we just
* gave up on validating the signature, (05/2008).
* 4) We encountered non-AML tables such as the MADT, which caused
* interpreter errors and kernel faults. So now, we once again allow
* only "SSDT", "OEMx", and now, also a null signature. (05/2011).
*/
if ((NewTableDesc.Signature.Ascii[0] != 0x00) &&
(!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) &&
(strncmp (NewTableDesc.Signature.Ascii, "OEM", 3)))
{
ACPI_BIOS_ERROR ((AE_INFO,
"Table has invalid signature [%4.4s] (0x%8.8X), "
"must be SSDT or OEMx",
AcpiUtValidNameseg (NewTableDesc.Signature.Ascii) ?
NewTableDesc.Signature.Ascii : "????",
NewTableDesc.Signature.Integer));

Status = AE_BAD_SIGNATURE;
goto UnlockAndExit;
}

/* Check if table is already registered */

for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)
Expand Down
4 changes: 2 additions & 2 deletions source/components/tables/tbxfload.c
Expand Up @@ -336,11 +336,11 @@ AcpiTbLoadNamespace (
{
Table = &AcpiGbl_RootTableList.Tables[i];

if (!AcpiGbl_RootTableList.Tables[i].Address ||
if (!Table->Address ||
(!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) &&
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) &&
!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) ||
ACPI_FAILURE (AcpiTbValidateTable (Table)))
ACPI_FAILURE (AcpiTbValidateTable (Table)))
{
continue;
}
Expand Down

0 comments on commit d3c944f

Please sign in to comment.