public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ATA: piix, fix pointer deref on suspend
@ 2008-12-03  8:13 Jiri Slaby
  2008-12-03  9:04 ` Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Jiri Slaby @ 2008-12-03  8:13 UTC (permalink / raw)
  To: Tejun Heo
  Cc: akpm, linux-kernel, Jiri Slaby, Jeff Garzik, Alexandru Romanescu,
	Tejun Heo

Hi,

I've found this issue in the mmotm 2008-12-02-17-08.

--

Commit
ata_piix: add borked Tecra M4 to broken suspend list
introduced DMI variables checking, but they can be null, so that
we possibly dereference null.

Check if they are null and avoid checks in that case.

Solves:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
IP: [<ffffffff8043da97>] piix_pci_device_suspend+0x117/0x230

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Alexandru Romanescu <a_romanescu@yahoo.co.uk>
Cc: Tejun Heo <tj@kernel.org>
---
 drivers/ata/ata_piix.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index d6d97d8..c11936e 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1072,7 +1072,14 @@ static int piix_broken_suspend(void)
 	 * matching is necessary because dmi_system_id.matches is
 	 * limited to four entries.
 	 */
-	if (!strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
+	if (dmi_get_system_info(DMI_SYS_VENDOR) &&
+	    dmi_get_system_info(DMI_PRODUCT_NAME) &&
+	    dmi_get_system_info(DMI_PRODUCT_VERSION) &&
+	    dmi_get_system_info(DMI_PRODUCT_SERIAL) &&
+	    dmi_get_system_info(DMI_BOARD_VENDOR) &&
+	    dmi_get_system_info(DMI_BOARD_NAME) &&
+	    dmi_get_system_info(DMI_BOARD_VERSION) &&
+	    !strcmp(dmi_get_system_info(DMI_SYS_VENDOR), "TOSHIBA") &&
 	    !strcmp(dmi_get_system_info(DMI_PRODUCT_NAME), "000000") &&
 	    !strcmp(dmi_get_system_info(DMI_PRODUCT_VERSION), "000000") &&
 	    !strcmp(dmi_get_system_info(DMI_PRODUCT_SERIAL), "000000") &&
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-12-29 12:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-03  8:13 [PATCH 1/1] ATA: piix, fix pointer deref on suspend Jiri Slaby
2008-12-03  9:04 ` Tejun Heo
2008-12-03 10:13 ` Alan Cox
2008-12-03 10:39   ` Tejun Heo
2008-12-09  5:47 ` Jeff Garzik
2008-12-09 20:52   ` [PATCH 1/2] DMI: add dmi_match Jiri Slaby
2008-12-09 20:52     ` [PATCH 2/2 v2] ATA: piix, fix pointer deref on suspend Jiri Slaby
2008-12-09 21:29       ` Jeff Garzik
2008-12-09 22:06         ` Jiri Slaby
2008-12-10 13:07         ` [PATCH 1/2] DMI: add dmi_match Jiri Slaby
2008-12-10 13:07           ` [PATCH 2/2] ATA: piix, cleanup dmi strings checking Jiri Slaby
2008-12-29 12:41           ` [PATCH 1/2] DMI: add dmi_match Jeff Garzik
2008-12-11 20:27       ` [PATCH 2/2 v2] ATA: piix, fix pointer deref on suspend Andrew Morton
2008-12-11 20:34         ` Jiri Slaby
2008-12-09 20:59     ` [PATCH 1/2] DMI: add dmi_match Alan Cox
2008-12-10  2:00     ` Tejun Heo
2008-12-11 20:29     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox