All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, Gary Hade <garyhade@us.ibm.com>,
	Bob Moore <robert.moore@intel.com>,
	Lin Ming <ming.m.lin@intel.com>
Subject: [PATCH v3 01/17] ACPICA: fixup after acpi_get_object_info() change
Date: Mon, 21 Sep 2009 13:28:49 -0600	[thread overview]
Message-ID: <20090921192849.21322.99657.stgit@bob.kio> (raw)
In-Reply-To: <20090921192656.21322.23072.stgit@bob.kio>

Commit 15b8dd53f5ffa changed info->hardware_id from a static array to
a pointer.  If hardware_id is non-NULL, it points to a NULL-terminated
string, so we don't need to terminate it explicitly.  However, it may
be NULL; in that case, we *can't* add a NULL terminator.

This causes a NULL pointer dereference oops for devices without _HID.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Lin Ming <ming.m.lin@intel.com>
CC: Bob Moore <robert.moore@intel.com>
CC: Gary Hade <garyhade@us.ibm.com>
---
 drivers/pci/hotplug/acpiphp_ibm.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index a9d926b..e7be66d 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -406,7 +406,6 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
 			__func__, status);
 		return retval;
 	}
-	info->hardware_id.string[sizeof(info->hardware_id.length) - 1] = '\0';
 
 	if (info->current_status && (info->valid & ACPI_VALID_HID) &&
 			(!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) ||


  reply	other threads:[~2009-09-21 19:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-21 19:28 [PATCH v3 00/17] ACPI: cleanups for hotplug Bjorn Helgaas
2009-09-21 19:28 ` Bjorn Helgaas [this message]
2009-09-21 19:28 ` [PATCH v3 02/17] ACPI: add debug for device addition Bjorn Helgaas
2009-09-21 19:28 ` [PATCH v3 03/17] ACPI: remove unused acpi_bus_scan_fixed() argument Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 04/17] ACPI: remove redundant "handle" and "parent" arguments Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 05/17] ACPI: save device_type in acpi_device Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 06/17] ACPI: use device_type rather than comparing HID Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 07/17] ACPI: remove acpi_device_set_context() "type" argument Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 08/17] ACPI: remove redundant "type" arguments Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 09/17] ACPI: remove unnecessary argument checking Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 10/17] ACPI: add acpi_bus_get_parent() and remove "parent" arguments Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 11/17] ACPI: convert acpi_bus_scan() to operate on an acpi_handle Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 12/17] ACPI: enumerate namespace before adding functional fixed hardware devices Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 13/17] ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPE Bjorn Helgaas
2009-09-23  3:09   ` ykzhao
2009-09-23 16:14     ` Bjorn Helgaas
2009-09-24  2:10       ` ykzhao
2009-09-24  3:31         ` Bjorn Helgaas
2009-09-21 19:29 ` [PATCH v3 14/17] ACPI: use acpi_walk_namespace() to enumerate devices Bjorn Helgaas
2009-09-21 19:30 ` [PATCH v3 15/17] ACPI: add acpi_bus_get_status_handle() Bjorn Helgaas
2009-09-21 19:30 ` [PATCH v3 16/17] ACPI: factor out device type and status checking Bjorn Helgaas
2009-09-21 19:30 ` [PATCH v3 17/17] ACPI: handle re-enumeration, when acpi_devices might already exist Bjorn Helgaas

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=20090921192849.21322.99657.stgit@bob.kio \
    --to=bjorn.helgaas@hp.com \
    --cc=garyhade@us.ibm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.