Mark Salyzyn
a73914c35b
[SCSI] libsas: fix panic when single phy is disabled on a wide port
...
When a wide port is being utilized to a target, if one disables only one
of the
phys, we get an OS crash:
BUG: unable to handle kernel NULL pointer dereference at
0000000000000238
IP: [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
PGD 4103f5067 PUD 41dba9067 PMD 0
Oops: 0002 [#1 ] SMP
last sysfs file: /sys/bus/pci/slots/5/address
CPU 0
Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl
auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt
llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom
dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt
iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3
jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix
libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl
auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt
llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom
dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt
iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3
jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix
libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
Pid: 5146, comm: scsi_wq_5 Not tainted
2.6.32-71.29.1.el6.lustre.7.x86_64 #1 Storage Server
RIP: 0010:[<ffffffff814ca9b1>] [<ffffffff814ca9b1>]
mutex_lock+0x21/0x50
RSP: 0018:ffff8803e4e33d30 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000238 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8803e664c800 RDI: 0000000000000238
RBP: ffff8803e4e33d40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000238 R14: ffff88041acb7200 R15: ffff88041c51ada0
FS: 0000000000000000(0000) GS:ffff880028200000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000238 CR3: 0000000410143000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process scsi_wq_5 (pid: 5146, threadinfo ffff8803e4e32000, task
ffff8803e4e294a0)
Stack:
ffff8803e664c800 0000000000000000 ffff8803e4e33d70 ffffffffa001f06e
<0> ffff8803e4e33d60 ffff88041c51ada0 ffff88041acb7200 ffff88041bc0aa00
<0> ffff8803e4e33d90 ffffffffa0032b6c 0000000000000014 ffff88041acb7200
Call Trace:
[<ffffffffa001f06e>] sas_port_delete_phy+0x2e/0xa0 [scsi_transport_sas]
[<ffffffffa0032b6c>] sas_unregister_devs_sas_addr+0xac/0xe0 [libsas]
[<ffffffffa0034914>] sas_ex_revalidate_domain+0x204/0x330 [libsas]
[<ffffffffa00307f0>] ? sas_revalidate_domain+0x0/0x90 [libsas]
[<ffffffffa0030855>] sas_revalidate_domain+0x65/0x90 [libsas]
[<ffffffff8108c7d0>] worker_thread+0x170/0x2a0
[<ffffffff81091ea0>] ? autoremove_wake_function+0x0/0x40
[<ffffffff8108c660>] ? worker_thread+0x0/0x2a0
[<ffffffff81091b36>] kthread+0x96/0xa0
[<ffffffff810141ca>] child_rip+0xa/0x20
[<ffffffff81091aa0>] ? kthread+0x0/0xa0
[<ffffffff810141c0>] ? child_rip+0x0/0x20
Code: ff ff 85 c0 75 ed eb d6 66 90 55 48 89 e5 48 83 ec 10 48 89 1c 24
4c 89 64 24 08 0f 1f 44 00 00 48 89 fb e8 92 f4 ff ff 48 89 df <f0> ff
0f 79 05 e8 25 00 00 00 65 48 8b 04 25 08 cc 00 00 48 2d
RIP [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
RSP <ffff8803e4e33d30>
CR2: 0000000000000238
The following patch is admittedly a band-aid, and does not solve the
root cause, but it still is a good candidate for hardening as a pointer
check before reference.
Signed-off-by: Mark Salyzyn <mark_salyzyn@us.xyratex.com>
Tested-by: Jack Wang <jack_wang@usish.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2011-10-02 13:28:55 -05:00
..
2011-09-22 11:17:32 +04:00
2011-05-10 10:16:21 +02:00
2011-03-31 11:26:23 -03:00
2011-05-24 13:08:39 -04:00
2011-05-01 16:32:23 -05:00
2011-03-31 11:26:23 -03:00
2011-07-27 13:21:40 -07:00
2011-07-27 14:59:02 +04:00
2011-07-28 12:08:55 +04:00
2011-08-28 19:42:06 -07:00
2011-09-26 09:28:01 -05:00
2011-07-28 11:38:47 +04:00
2011-07-26 16:49:47 -07:00
2011-08-28 19:38:43 -07:00
2011-06-29 16:05:41 -05:00
2011-06-29 12:08:39 -05:00
2011-08-23 20:06:14 -07:00
2011-08-28 19:40:30 -07:00
2011-10-02 13:28:55 -05:00
2011-07-27 15:17:10 +04:00
2011-07-27 15:45:22 +04:00
2011-07-26 13:56:27 +04:00
2011-07-26 12:59:55 +04:00
2011-01-24 12:06:31 -06:00
2011-05-24 13:28:35 -07:00
2011-07-26 16:49:47 -07:00
2011-10-02 11:58:30 -05:00
2011-09-10 17:31:31 -07:00
2011-03-31 11:26:23 -03:00
2011-09-26 09:28:58 -05:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2009-12-04 12:00:51 -06:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2010-12-22 18:57:02 +01:00
2010-05-26 19:51:08 +02:00
2010-05-26 19:51:07 +02:00
2010-05-26 19:51:08 +02:00
2010-05-26 19:51:07 +02:00
2010-05-26 19:51:09 +02:00
2011-03-31 11:26:23 -03:00
2011-06-29 15:09:11 -05:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-06-29 15:11:21 -05:00
2011-06-29 15:11:21 -05:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2010-03-30 22:02:32 +09:00
2010-10-22 10:52:56 -07:00
2011-05-23 09:12:26 -07:00
2011-05-01 10:22:40 -05:00
2011-03-31 11:26:23 -03:00
2009-12-04 23:41:47 +01:00
2011-05-01 10:22:40 -05:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2011-05-01 10:22:40 -05:00
2011-05-01 10:22:40 -05:00
2011-05-23 09:12:26 -07:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2010-01-18 10:48:16 -06:00
2010-12-31 09:50:09 -06:00
2010-01-18 10:48:16 -06:00
2010-12-31 09:50:09 -06:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-05-26 19:51:08 +02:00
2010-10-22 19:36:42 -07:00
2011-05-17 11:07:01 +04:00
2011-08-26 12:52:39 -07:00
2011-07-27 15:18:26 +04:00
2010-11-16 13:33:23 -08:00
2009-10-02 09:45:22 -05:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2011-05-26 13:19:00 -07:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-07-27 17:45:08 +04:00
2011-05-01 12:10:34 -05:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-06-29 16:43:06 -05:00
2011-06-29 16:43:08 -05:00
2011-02-24 12:41:10 -05:00
2010-03-30 22:02:32 +09:00
2011-09-23 16:02:33 -07:00
2010-03-30 22:02:32 +09:00
2011-06-29 16:43:10 -05:00
2011-07-25 07:48:08 +00:00
2010-03-30 22:02:32 +09:00
2010-11-16 13:33:23 -08:00
2010-03-30 22:02:32 +09:00
2011-06-29 15:12:43 -05:00
2011-09-22 11:25:48 +04:00
2011-05-01 10:22:40 -05:00
2011-03-31 11:26:23 -03:00
2011-05-01 10:22:40 -05:00
2010-03-30 22:02:32 +09:00
2010-05-26 19:51:07 +02:00
2010-05-02 15:55:03 -04:00
2011-05-01 10:22:40 -05:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2011-05-10 10:16:21 +02:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-05-24 13:09:41 -04:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2011-07-27 17:26:21 +04:00
2011-05-26 13:19:00 -07:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2011-05-01 10:22:40 -05:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2011-05-18 12:32:23 -06:00
2010-08-06 09:25:50 -06:00
2010-03-03 21:17:06 +05:30
2011-03-31 11:26:23 -03:00
2011-06-29 15:08:47 -05:00
2011-05-24 12:51:53 -04:00
2009-12-04 12:01:33 -06:00
2009-12-04 12:01:30 -06:00
2011-07-27 14:06:01 +04:00
2011-03-31 11:26:23 -03:00
2011-07-02 14:30:10 +02:00
2011-03-17 17:54:40 -07:00
2011-05-28 23:12:11 -07:00
2010-02-08 17:15:19 -06:00
2011-06-02 18:34:43 +09:00
2009-11-18 08:37:40 -08:00
2011-06-02 18:34:43 +09:00
2010-10-22 10:52:56 -07:00
2011-05-01 10:20:10 -05:00
2011-05-24 12:38:36 -04:00
2011-05-20 13:29:52 -07:00
2011-03-23 11:35:58 -05:00
2011-03-10 08:52:07 +01:00
2011-07-26 13:53:50 +04:00
2010-11-16 13:33:23 -08:00
2010-03-30 22:02:32 +09:00
2010-10-15 15:49:20 +02:00
2011-05-24 12:43:52 -04:00
2011-03-14 18:37:34 -05:00
2011-06-29 12:14:25 -05:00
2010-10-24 13:41:39 -07:00
2011-04-06 06:19:38 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-12-16 17:53:39 +01:00
2010-03-30 22:02:32 +09:00
2011-07-21 14:15:58 -07:00
2011-07-21 14:15:58 -07:00
2010-12-22 23:26:50 -06:00
2009-12-10 08:54:13 -06:00
2010-11-16 13:33:23 -08:00
2011-06-29 15:15:05 -05:00
2011-06-29 15:14:54 -05:00
2011-06-29 15:14:54 -05:00
2010-11-16 13:33:23 -08:00
2010-03-30 22:02:32 +09:00
2011-02-28 01:36:39 -07:00
2011-03-31 11:26:23 -03:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2011-05-01 10:22:40 -05:00
2011-05-01 10:22:40 -05:00
2011-05-24 13:25:35 -04:00
2010-11-16 13:33:23 -08:00
2010-11-16 13:33:23 -08:00
2009-12-04 12:00:49 -06:00
2011-05-26 13:19:00 -07:00
2010-11-16 13:33:23 -08:00
2011-03-31 11:26:23 -03:00
2010-05-17 21:37:41 +02:00