From: donald.d.dugger@intel.com
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix possible NULL ptr dereference in ACPI code
Date: Mon, 13 Oct 2008 14:28:39 -0700 [thread overview]
Message-ID: <200810132128.m9DLSdal028794@los-vmm.sc.intel.com> (raw)
Code in file `drivers/acpi/pci_link.c' is attempting to evaluate the _DIS
method to disable a link. Unfortunately, the method code unconditionally
uses the last argument as a pointer on success so passing a NULL could
wind up dereferencing 0. This patch just passes an appropriate pointer
to avoid this issue.
Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
----- cut here for acpi-1013.patch -----
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index cf47805..1d03a1f 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -671,6 +671,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
{
struct acpi_device *device = NULL;
struct acpi_pci_link *link = NULL;
+ union acpi_operand_object *dummy;
acpi_status result;
@@ -709,7 +710,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
acpi_device_bid(link->device)));
if (link->refcnt == 0) {
- acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL);
+ acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, &dummy);
}
mutex_unlock(&acpi_link_lock);
return (link->irq.active);
@@ -721,6 +722,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
static int acpi_pci_link_add(struct acpi_device *device)
{
+ union acpi_operand_object *dummy;
int result = 0;
struct acpi_pci_link *link = NULL;
int i = 0;
@@ -773,7 +775,7 @@ static int acpi_pci_link_add(struct acpi_device *device)
end:
/* disable all links -- to be activated on use */
- acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);
+ acpi_ut_evaluate_object(device->handle, "_DIS", 0, &dummy);
mutex_unlock(&acpi_link_lock);
if (result)
reply other threads:[~2008-10-13 21:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200810132128.m9DLSdal028794@los-vmm.sc.intel.com \
--to=donald.d.dugger@intel.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®