lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 24 Oct 2008 07:57:51 -0700
From:	"Moore, Robert" <robert.moore@...el.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>,
	James Bottomley <James.Bottomley@...senpartnership.com>,
	Jesse Barnes <jbarnes@...tuousgeek.org>
CC:	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Len Brown <lenb@...nel.org>
Subject: RE: Oops in ACPI with git latest

Since acpi_evaluate_object doesn't set the pointer value, it may be simply random.

>-----Original Message-----
>From: Rafael J. Wysocki [mailto:rjw@...k.pl]
>Sent: Thursday, October 23, 2008 11:57 PM
>To: James Bottomley; Jesse Barnes
>Cc: Moore, Robert; linux-acpi@...r.kernel.org; linux-kernel; Len Brown
>Subject: Re: Oops in ACPI with git latest
>
>On Friday, 24 of October 2008, James Bottomley wrote:
>> On Thu, 2008-10-23 at 15:34 -0700, Moore, Robert wrote:
>> > +	if (!output.pointer)
>> > +		return AE_NULL_OBJECT;
>> > +
>> >
>> > This probably won't work. acpi_evaluate_object currently doesn't touch
>the pointer parameter if there is no return value, it only sets the length
>to zero.
>>
>> Actually, it does.
>
>Well, this was the only candidate for a NULL pointer dereference, so I'd be
>surprised if it didn't. :-)
>
>> > So, you might try this:
>> >
>> > +	if (!output.length)
>> > +		return AE_NULL_OBJECT;
>> > +
>
>Still, I'd expect the AML interpreter to return error code in this case.
>
>> This also works.
>
>Why don't we make it extra safe, then. ;-)
>
>---
>From: Rafael J. Wysocki <rjw@...k.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@...k.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");
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ