[PATCH 13/16] ACPICA: iASL: Ensure that the target node is valid in acpi_ex_create_alias

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

 



From: Alex James <theracermaster@xxxxxxxxx>

ACPICA commit 8b14afac65d983610cc5387ede6d85ea5ee075be

The following ACPI table contains an invalid target node within the
Alias operator:

definition_block ("", "SSDT", 1, "Bug", "BugTable", 0x00001000)
{
    Scope (_SB)
    {
        Device (DEV0)
        {
            Name (_ADR, 1)

            Device (DEV1)
            {
                Alias (_ADR, _ADR)
            }
        }
    }
}

If an ACPI table contains such an invalid target node in an Alias
operator, a segmentation fault will occur when the target node is
dereferenced within acpi_ex_create_alias. Add a check for such an invalid
target node in acpi_ex_create_alias and return AE_NULL_OBJECT as suggested
by @acpibob.

Link: https://github.com/acpica/acpica/commit/8b14afac
Signed-off-by: Alex James <theracermaster@xxxxxxxxx>
Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx>
Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
---
 drivers/acpi/acpica/excreate.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
index d43d7da..6867586 100644
--- a/drivers/acpi/acpica/excreate.c
+++ b/drivers/acpi/acpica/excreate.c
@@ -87,6 +87,11 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
 				  target_node->object);
 	}
 
+	/* Ensure that the target node is valid */
+	if (!target_node) {
+		return_ACPI_STATUS(AE_NULL_OBJECT);
+	}
+
 	/*
 	 * For objects that can never change (i.e., the NS node will
 	 * permanently point to the same object), we can simply attach
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux