-
Notifications
You must be signed in to change notification settings - Fork 2
/
2.6.32.54.18.scsi-scsi_dh-check-queuedata-pointer-before-proceeding-further.patch
59 lines (49 loc) · 2.43 KB
/
2.6.32.54.18.scsi-scsi_dh-check-queuedata-pointer-before-proceeding-further.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From a18a920c70d48a8e4a2b750d8a183b3c1a4be514 Mon Sep 17 00:00:00 2001
From: "Moger, Babu" <[email protected]>
Date: Wed, 26 Oct 2011 14:29:38 -0400
Subject: SCSI: scsi_dh: check queuedata pointer before proceeding further
From: "Moger, Babu" <[email protected]>
commit a18a920c70d48a8e4a2b750d8a183b3c1a4be514 upstream.
This patch validates sdev pointer in scsi_dh_activate before proceeding further.
Without this check we might see the panic as below. I have seen this
panic multiple times..
Call trace:
#0 [ffff88007d647b50] machine_kexec at ffffffff81020902
#1 [ffff88007d647ba0] crash_kexec at ffffffff810875b0
#2 [ffff88007d647c70] oops_end at ffffffff8139c650
#3 [ffff88007d647c90] __bad_area_nosemaphore at ffffffff8102dd15
#4 [ffff88007d647d50] page_fault at ffffffff8139b8cf
[exception RIP: scsi_dh_activate+0x82]
RIP: ffffffffa0041922 RSP: ffff88007d647e00 RFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000000093c5
RDX: 00000000000093c5 RSI: ffffffffa02e6640 RDI: ffff88007cc88988
RBP: 000000000000000f R8: ffff88007d646000 R9: 0000000000000000
R10: ffff880082293790 R11: 00000000ffffffff R12: ffff88007cc88988
R13: 0000000000000000 R14: 0000000000000286 R15: ffff880037b845e0
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0000
#5 [ffff88007d647e38] run_workqueue at ffffffff81060268
#6 [ffff88007d647e78] worker_thread at ffffffff81060386
#7 [ffff88007d647ee8] kthread at ffffffff81064436
#8 [ffff88007d647f48] kernel_thread at ffffffff81003fba
Signed-off-by: Babu Moger <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/scsi/device_handler/scsi_dh.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff -r 4f54f57f93d2 drivers/scsi/device_handler/scsi_dh.c
--- a/drivers/scsi/device_handler/scsi_dh.c Thu Nov 03 00:59:25 2011 +0100
+++ b/drivers/scsi/device_handler/scsi_dh.c Wed May 23 14:59:55 2012 +0100
@@ -448,7 +448,11 @@ int scsi_dh_activate(struct request_queu
spin_lock_irqsave(q->queue_lock, flags);
sdev = scsi_device_from_queue(q);
- if (sdev && sdev->scsi_dh_data)
+ if (!sdev) {
+ spin_unlock_irqrestore(q->queue_lock, flags);
+ return SCSI_DH_NOSYS;
+ }
+ if (sdev->scsi_dh_data)
scsi_dh = sdev->scsi_dh_data->scsi_dh;
if (!scsi_dh || !get_device(&sdev->sdev_gendev))
err = SCSI_DH_NOSYS;