diff mbox

acpica: Fix segfault when disassembling AML (LP: #1050475)

Message ID 1347550816-30905-1-git-send-email-colin.king@canonical.com
State Rejected
Headers show

Commit Message

Colin Ian King Sept. 13, 2012, 3:40 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Running fwts against a collection of test tables I found a segfault
in source/components/disassembler/dmopcode.c:334, due to Tag being
null. This patch is a fix from Robert Moore at Intel which will land
in the September release of ACPICA/iASL.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpica/source/common/dmrestag.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Colin Ian King Sept. 13, 2012, 3:47 p.m. UTC | #1
On 13/09/12 16:40, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Running fwts against a collection of test tables I found a segfault
> in source/components/disassembler/dmopcode.c:334, due to Tag being
> null. This patch is a fix from Robert Moore at Intel which will land
> in the September release of ACPICA/iASL.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpica/source/common/dmrestag.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c
> index 9afaad3..3097f15 100644
> --- a/src/acpica/source/common/dmrestag.c
> +++ b/src/acpica/source/common/dmrestag.c
> @@ -541,6 +541,11 @@ AcpiDmCheckResourceReference (
>       /* Get the Index term, must be an integer constant to convert */
>
>       IndexOp = BufferNameOp->Common.Next;
> +
> +    /* Major cheat: The Node field is also used for the Tag ptr. Clear it now */
> +
> +    IndexOp->Common.Node = NULL;
> +
>       OpInfo = AcpiPsGetOpcodeInfo (IndexOp->Common.AmlOpcode);
>       if (OpInfo->ObjectType != ACPI_TYPE_INTEGER)
>       {
>

Bah, forgot the second part, NACK from me. Will re-do. Doh.
diff mbox

Patch

diff --git a/src/acpica/source/common/dmrestag.c b/src/acpica/source/common/dmrestag.c
index 9afaad3..3097f15 100644
--- a/src/acpica/source/common/dmrestag.c
+++ b/src/acpica/source/common/dmrestag.c
@@ -541,6 +541,11 @@  AcpiDmCheckResourceReference (
     /* Get the Index term, must be an integer constant to convert */
 
     IndexOp = BufferNameOp->Common.Next;
+
+    /* Major cheat: The Node field is also used for the Tag ptr. Clear it now */
+
+    IndexOp->Common.Node = NULL;
+
     OpInfo = AcpiPsGetOpcodeInfo (IndexOp->Common.AmlOpcode);
     if (OpInfo->ObjectType != ACPI_TYPE_INTEGER)
     {