public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "Moore, Robert" <robert.moore@intel.com>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>
Subject: Re: Oops in ACPI with git latest
Date: Fri, 24 Oct 2008 20:43:03 +0200	[thread overview]
Message-ID: <200810242043.04078.rjw@sisk.pl> (raw)
In-Reply-To: <200810241104.19704.jbarnes@virtuousgeek.org>

On Friday, 24 of October 2008, Jesse Barnes wrote:
> So who wants to send me a final patch for this?

I already did: http://marc.info/?l=linux-kernel&m=122484871717023&w=4
but I can remove the "!output.pointer || " if you prefer. :-)

Thanks,
Rafael


> On Friday, October 24, 2008 7:57 am Moore, Robert wrote:
> > Since acpi_evaluate_object doesn't set the pointer value, it may be simply
> > random.
> >
> > >-----Original Message-----
> > >From: Rafael J. Wysocki [mailto:rjw@sisk.pl]
> > >Sent: Thursday, October 23, 2008 11:57 PM
> > >To: James Bottomley; Jesse Barnes
> > >Cc: Moore, Robert; linux-acpi@vger.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@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");
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> 



  reply	other threads:[~2008-10-24 18:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23 19:45 Oops in ACPI with git latest James Bottomley
2008-10-23 20:42 ` Rafael J. Wysocki
2008-10-23 22:34   ` Moore, Robert
2008-10-24  1:27     ` James Bottomley
2008-10-24  6:57       ` Rafael J. Wysocki
2008-10-24 11:49         ` [PATCH] Subject: Prevent acpi_run_osc from using NULL objects (was: Re: Oops in ACPI with git latest) Rafael J. Wysocki
2008-10-24 15:02           ` Moore, Robert
2008-10-24 20:27             ` Len Brown
2008-10-24 20:43               ` Moore, Robert
2008-10-24 14:57         ` Oops in ACPI with git latest Moore, Robert
2008-10-24 18:04           ` Jesse Barnes
2008-10-24 18:43             ` Rafael J. Wysocki [this message]
2008-10-24 19:22               ` Jesse Barnes
2008-10-24 19:50                 ` Rafael J. Wysocki
2008-10-24 20:42                   ` Len Brown
2008-10-24  1:17   ` James Bottomley
2008-10-24  6:47     ` Rafael J. Wysocki
2008-10-24 15:04       ` Moore, Robert
2008-10-24  1:17 ` Lin Ming
2008-10-24 15:37   ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810242043.04078.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox