Re: Oops in ACPI with git latest

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rafael J. Wysocki
Date: Thursday, October 23, 2008 - 11:57 pm

On Friday, 24 of October 2008, James Bottomley wrote:

Well, this was the only candidate for a NULL pointer dereference, so I'd be
surprised if it didn't. :-)


Still, I'd expect the AML interpreter to return error code in this case.


Why don't we make it extra safe, then. ;-)

---
From: Rafael J. Wysocki <rjw@sisk.pl>
Subject: Prevent acpi_osc_run from using NULL objects

Check if the object returned by acpi_evaluate_object() in
acpi_run_osc() is not NULL.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/pci/pci-acpi.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/drivers/pci/pci-acpi.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci-acpi.c
+++ linux-2.6/drivers/pci/pci-acpi.c
@@ -83,6 +83,9 @@ static acpi_status acpi_run_osc(acpi_han
 	if (ACPI_FAILURE(status))
 		return status;
 
+	if (!output.pointer || !output.length)
+		return AE_NULL_OBJECT;
+
 	out_obj = output.pointer;
 	if (out_obj->type != ACPI_TYPE_BUFFER) {
 		printk(KERN_DEBUG "Evaluate _OSC returns wrong type\n");
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Oops in ACPI with git latest, James Bottomley, (Thu Oct 23, 12:45 pm)
Re: Oops in ACPI with git latest, Rafael J. Wysocki, (Thu Oct 23, 1:42 pm)
RE: Oops in ACPI with git latest, Moore, Robert, (Thu Oct 23, 3:34 pm)
Re: Oops in ACPI with git latest, James Bottomley, (Thu Oct 23, 6:17 pm)
Re: Oops in ACPI with git latest, Lin Ming, (Thu Oct 23, 6:17 pm)
RE: Oops in ACPI with git latest, James Bottomley, (Thu Oct 23, 6:27 pm)
Re: Oops in ACPI with git latest, Rafael J. Wysocki, (Thu Oct 23, 11:47 pm)
Re: Oops in ACPI with git latest, Rafael J. Wysocki, (Thu Oct 23, 11:57 pm)
[PATCH] Subject: Prevent acpi_run_osc from using NULL obje ..., Rafael J. Wysocki, (Fri Oct 24, 4:49 am)
RE: Oops in ACPI with git latest, Moore, Robert, (Fri Oct 24, 7:57 am)
RE: Oops in ACPI with git latest, Moore, Robert, (Fri Oct 24, 8:04 am)
Re: Oops in ACPI with git latest, James Bottomley, (Fri Oct 24, 8:37 am)
Re: Oops in ACPI with git latest, Jesse Barnes, (Fri Oct 24, 11:04 am)
Re: Oops in ACPI with git latest, Rafael J. Wysocki, (Fri Oct 24, 11:43 am)
Re: Oops in ACPI with git latest, Jesse Barnes, (Fri Oct 24, 12:22 pm)
Re: Oops in ACPI with git latest, Rafael J. Wysocki, (Fri Oct 24, 12:50 pm)
Re: Oops in ACPI with git latest, Len Brown, (Fri Oct 24, 1:42 pm)