linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mpt2sas: Fix null reference in recovery_delete_devices
@ 2011-11-10 16:05 Yinghai Lu
  2011-11-14  5:53 ` Nandigama, Nagalakshmi
  0 siblings, 1 reply; 2+ messages in thread
From: Yinghai Lu @ 2011-11-10 16:05 UTC (permalink / raw)
  To: James E.J. Bottomley, Nagalakshmi Nandigama
  Cc: Kashyap Desai, Eric Moore, linux-scsi, linux-kernel


Got panic:
[  752.590700] BUG: unable to handle kernel NULL pointer dereference at 00000000000000f6
[  752.598542] IP: [<ffffffff8160b5f3>] mpt2sas_scsih_reset_handler+0x168/0x183
[  752.605595] PGD 175d43067 PUD 175d44067 PMD 0 
[  752.610081] Oops: 0002 [#1] SMP 
[  752.613342] CPU 0 
[  752.615175] Modules linked in:
[  752.618428] 
[  752.619921] Pid: 9187, comm: sas2flash Not tainted 3.2.0-rc1-tip-yh-01580-g878f195-dirty #1288 Oracle Corporation Sun Blade
[  752.632632] RIP: 0010:[<ffffffff8160b5f3>]  [<ffffffff8160b5f3>] mpt2sas_scsih_reset_handler+0x168/0x183

it turns out it is introduced in

_scsih_error_recovery_delete_devices() forget to alloc the event before using.

It is introduced by:

| commit 921cd8024b908f8f49f772c8d3a02381b4db2ed2
| Author: nagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
| Date:   Wed Oct 19 15:36:26 2011 +0530
|
|    [SCSI] mpt2sas: New feature - Fast Load Support

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_scsih.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2802,6 +2802,9 @@ _scsih_error_recovery_delete_devices(str
 
 	if (ioc->is_driver_loading)
 		return;
+	fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
+	if (!fw_event)
+		return;
 	fw_event->event = MPT2SAS_REMOVE_UNRESPONDING_DEVICES;
 	fw_event->ioc = ioc;
 	_scsih_fw_event_add(ioc, fw_event);

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

* RE: [PATCH] mpt2sas: Fix null reference in recovery_delete_devices
  2011-11-10 16:05 [PATCH] mpt2sas: Fix null reference in recovery_delete_devices Yinghai Lu
@ 2011-11-14  5:53 ` Nandigama, Nagalakshmi
  0 siblings, 0 replies; 2+ messages in thread
From: Nandigama, Nagalakshmi @ 2011-11-14  5:53 UTC (permalink / raw)
  To: Yinghai Lu, James Bottomley
  Cc: Desai, Kashyap, Moore, Eric, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org

A similar patch to fix this issue was already posted by Dan Carpenter.  

Regards,
Nagalakshmi


-----Original Message-----
From: Yinghai Lu [mailto:yinghai.lu@oracle.com] 
Sent: Thursday, November 10, 2011 9:35 PM
To: James E.J. Bottomley; Nandigama, Nagalakshmi
Cc: Desai, Kashyap; Moore, Eric; linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: [PATCH] mpt2sas: Fix null reference in recovery_delete_devices


Got panic:
[  752.590700] BUG: unable to handle kernel NULL pointer dereference at 00000000000000f6
[  752.598542] IP: [<ffffffff8160b5f3>] mpt2sas_scsih_reset_handler+0x168/0x183
[  752.605595] PGD 175d43067 PUD 175d44067 PMD 0 
[  752.610081] Oops: 0002 [#1] SMP 
[  752.613342] CPU 0 
[  752.615175] Modules linked in:
[  752.618428] 
[  752.619921] Pid: 9187, comm: sas2flash Not tainted 3.2.0-rc1-tip-yh-01580-g878f195-dirty #1288 Oracle Corporation Sun Blade
[  752.632632] RIP: 0010:[<ffffffff8160b5f3>]  [<ffffffff8160b5f3>] mpt2sas_scsih_reset_handler+0x168/0x183

it turns out it is introduced in

_scsih_error_recovery_delete_devices() forget to alloc the event before using.

It is introduced by:

| commit 921cd8024b908f8f49f772c8d3a02381b4db2ed2
| Author: nagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
| Date:   Wed Oct 19 15:36:26 2011 +0530
|
|    [SCSI] mpt2sas: New feature - Fast Load Support

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-2.6/drivers/scsi/mpt2sas/mpt2sas_scsih.c
===================================================================
--- linux-2.6.orig/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ linux-2.6/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -2802,6 +2802,9 @@ _scsih_error_recovery_delete_devices(str
 
 	if (ioc->is_driver_loading)
 		return;
+	fw_event = kzalloc(sizeof(struct fw_event_work), GFP_ATOMIC);
+	if (!fw_event)
+		return;
 	fw_event->event = MPT2SAS_REMOVE_UNRESPONDING_DEVICES;
 	fw_event->ioc = ioc;
 	_scsih_fw_event_add(ioc, fw_event);

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

end of thread, other threads:[~2011-11-14  5:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-10 16:05 [PATCH] mpt2sas: Fix null reference in recovery_delete_devices Yinghai Lu
2011-11-14  5:53 ` Nandigama, Nagalakshmi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).