From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
Mark Salyzyn <mark_salyzyn@us.xyratex.com>,
James Bottomley <JBottomley@Parallels.com>
Subject: [046/101] [SCSI] libsas: fix panic when single phy is disabled on a wide port
Date: Wed, 02 Nov 2011 15:26:30 -0700 [thread overview]
Message-ID: <20111102222743.946722537@clark.kroah.org> (raw)
In-Reply-To: <20111102222755.GA10893@kroah.com>
2.6.33-longterm review patch. If anyone has any objections, please let us know.
------------------
From: Mark Salyzyn <mark_salyzyn@us.xyratex.com>
commit a73914c35b05d80f8ce78288e10056c91090b666 upstream.
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>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/scsi/libsas/sas_expander.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1757,10 +1757,12 @@ static void sas_unregister_devs_sas_addr
sas_disable_routing(parent, phy->attached_sas_addr);
}
memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
- sas_port_delete_phy(phy->port, phy->phy);
- if (phy->port->num_phys == 0)
- sas_port_delete(phy->port);
- phy->port = NULL;
+ if (phy->port) {
+ sas_port_delete_phy(phy->port, phy->phy);
+ if (phy->port->num_phys == 0)
+ sas_port_delete(phy->port);
+ phy->port = NULL;
+ }
}
static int sas_discover_bfs_by_root_level(struct domain_device *root,
next prev parent reply other threads:[~2011-11-03 1:40 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 22:27 [000/101] 2.6.33.20-longterm review Greg KH
2011-11-02 22:25 ` [001/101] USB: ftdi_sio: add Calao reference board support Greg KH
2011-11-02 22:25 ` [002/101] USB: EHCI: Do not rely on PORT_SUSPEND to stop USB resuming in ehci_bus_resume() Greg KH
2011-11-02 22:25 ` [003/101] rt2x00: do not drop usb dev reference counter on suspend Greg KH
2011-11-02 22:25 ` [004/101] atm: br2684: Fix oops due to skb->dev being NULL Greg KH
2011-11-02 22:25 ` [005/101] sparc64: remove unnecessary macros from spinlock_64.h Greg KH
2011-11-02 22:25 ` [006/101] sparc32: unbreak arch_write_unlock() Greg KH
2011-11-02 22:25 ` [007/101] sparc: fix array bounds error setting up PCIC NMI trap Greg KH
2011-11-02 22:25 ` [008/101] ipv6: Add GSO support on forwarding path Greg KH
2011-11-02 22:25 ` [009/101] Revert "x86, hotplug: Use mwait to offline a processor, fix the legacy case" Greg KH
2011-11-02 22:25 ` [010/101] GRO: fix merging a paged skb after non-paged skbs Greg KH
2011-11-02 22:25 ` [011/101] xen-blkfront: fix data size for xenbus_gather in blkfront_connect Greg KH
2011-11-02 22:25 ` [012/101] md/linear: avoid corrupting structure while waiting for rcu_free to complete Greg KH
2011-11-02 22:25 ` [013/101] powerpc/pci: Check devices status property when scanning OF tree Greg KH
2011-11-02 22:25 ` [014/101] xen: x86_32: do not enable iterrupts when returning from exception in interrupt context Greg KH
2011-11-02 22:25 ` [015/101] xen/smp: Warn user why they keel over - nosmp or noapic and what to use instead Greg KH
2011-11-02 22:26 ` [016/101] ARM: davinci: da850 EVM: read mac address from SPI flash Greg KH
2011-11-02 22:26 ` [017/101] md: Fix handling for devices from 2TB to 4TB in 0.90 metadata Greg KH
2011-11-02 22:26 ` [018/101] net/9p: fix client code to fail more gracefully on protocol error Greg KH
2011-11-02 22:26 ` [019/101] fs/9p: Fid is not valid after a failed clunk Greg KH
2011-11-02 22:26 ` [020/101] fs/9p: Fix invalid mount options/args Greg KH
2011-11-02 22:26 ` [021/101] net/9p: Fix the msize calculation Greg KH
2011-11-02 22:26 ` [022/101] irda: fix smsc-ircc2 section mismatch warning Greg KH
2011-11-02 22:26 ` [023/101] [SCSI] qla2xxx: Correct inadvertent loop state transitions during port-update handling Greg KH
2011-11-02 22:26 ` [024/101] e1000: Fix driver to be used on PA RISC C8000 workstations Greg KH
2011-11-02 22:26 ` [025/101] ASoC: Fix reporting of partial jack updates Greg KH
2011-11-02 22:26 ` [026/101] ALSA: HDA: Cirrus - fix "Surround Speaker" volume control name Greg KH
2011-11-02 22:26 ` [027/101] drm/radeon/kms: fix typo in r100_blit_copy Greg KH
2011-11-03 13:01 ` Deucher, Alexander
2011-11-02 22:26 ` [028/101] cifs: fix possible memory corruption in CIFSFindNext Greg KH
2011-11-02 22:26 ` [029/101] b43: Fix beacon problem in ad-hoc mode Greg KH
2011-11-02 22:26 ` [030/101] wireless: Reset beacon_found while updating regulatory Greg KH
2011-11-02 22:26 ` [031/101] rtl2800usb: Fix incorrect storage of MAC address on big-endian platforms Greg KH
2011-11-02 22:26 ` [032/101] USB: PL2303: correctly handle baudrates above 115200 Greg KH
2011-11-02 22:26 ` [033/101] ASIX: Add AX88772B USB ID Greg KH
2011-11-02 22:26 ` [034/101] [SCSI] fcoe: Unable to select the exchangeID from offload pool for storage targets Greg KH
2011-11-02 22:26 ` [035/101] hvc_console: Improve tty/console put_chars handling Greg KH
2011-11-02 22:26 ` [036/101] TPM: Call tpm_transmit with correct size Greg KH
2011-11-02 22:26 ` [037/101] TPM: Zero buffer after copying to userspace Greg KH
2011-11-02 22:26 ` [038/101] [SCSI] libiscsi_tcp: fix LLD data allocation Greg KH
2011-11-02 22:26 ` [039/101] cnic: Improve NETDEV_UP event handling Greg KH
2011-11-02 22:26 ` [040/101] ALSA: hda/realtek - Avoid bogus HP-pin assignment Greg KH
2011-11-02 22:26 ` [041/101] [SCSI] 3w-9xxx: fix iommu_iova leak Greg KH
2011-11-02 22:26 ` [042/101] [SCSI] aacraid: reset should disable MSI interrupt Greg KH
2011-11-02 22:26 ` [043/101] [SCSI] libsas: fix failure to revalidate domain for anything but the first expander child Greg KH
2011-11-02 22:26 ` [044/101] cfg80211: Fix validation of AKM suites Greg KH
2011-11-02 22:26 ` [045/101] splice: direct_splice_actor() should not use pos in sd Greg KH
2011-11-02 22:26 ` Greg KH [this message]
2011-11-02 22:26 ` [047/101] ahci: Enable SB600 64bit DMA on Asus M3A Greg KH
2011-11-02 22:26 ` [048/101] HID: usbhid: Add support for SiGma Micro chip Greg KH
2011-11-02 22:26 ` [049/101] hwmon: (w83627ehf) Properly report thermal diode sensors Greg KH
2011-11-02 22:26 ` [050/101] x25: Prevent skb overreads when checking call user data Greg KH
2011-11-02 22:26 ` [051/101] block: check for proper length of iov entries earlier in blk_rq_map_user_iov() Greg KH
2011-11-02 22:26 ` [052/101] staging: quatech_usb2: Potential lost wakeup scenario in TIOCMIWAIT Greg KH
2011-11-02 22:26 ` [053/101] USB: qcserial: add device ID for "HP un2430 Mobile Broadband Module" Greg KH
2011-11-02 22:26 ` [054/101] xhci-mem.c: Check for ring->first_seg != NULL Greg KH
2011-11-02 22:26 ` [055/101] [SCSI] ipr: Always initiate hard reset in kdump kernel Greg KH
2011-11-02 22:26 ` [056/101] [SCSI] libsas: set sas_address and device type of rphy Greg KH
2011-11-02 22:26 ` [057/101] ALSA: HDA: Add new revision for ALC662 Greg KH
2011-11-02 22:26 ` [058/101] x86: Fix compilation bug in kprobes twobyte_is_boostable Greg KH
2011-11-02 22:26 ` [059/101] epoll: fix spurious lockdep warnings Greg KH
2011-11-02 22:26 ` [060/101] usbmon vs. tcpdump: fix dropped packet count Greg KH
2011-11-02 22:26 ` [061/101] USB: storage: Use normalized sense when emulating autosense Greg KH
2011-11-02 22:26 ` [062/101] usb/core/devio.c: Check for printer class specific request Greg KH
2011-11-02 22:26 ` [063/101] USB: pid_ns: ensure pid is not freed during kill_pid_info_as_uid Greg KH
2011-11-02 22:26 ` [064/101] usb: cdc-acm: Owen SI-30 support Greg KH
2011-11-02 22:26 ` [065/101] USB: pl2303: add id for SMART device Greg KH
2011-11-02 22:26 ` [066/101] USB: ftdi_sio: add PID for Sony Ericsson Urban Greg KH
2011-11-02 22:26 ` [067/101] USB: ftdi_sio: Support TI/Luminary Micro Stellaris BD-ICDI Board Greg KH
2011-11-02 22:26 ` [068/101] QE/FHCI: fixed the CONTROL bug Greg KH
2011-11-02 22:26 ` [069/101] Update email address for stable patch submission Greg KH
2011-11-02 22:26 ` [070/101] kobj_uevent: Ignore if some listeners cannot handle message Greg KH
2011-11-02 22:26 ` [071/101] kmod: prevent kmod_loop_msg overflow in __request_module() Greg KH
2011-11-02 22:26 ` [072/101] time: Change jiffies_to_clock_t() argument type to unsigned long Greg KH
2011-11-02 22:26 ` [073/101] tracing: Fix returning of duplicate data after EOF in trace_pipe_raw Greg KH
2011-11-02 22:26 ` [074/101] nfsd4: Remove check for a 32-bit cookie in nfsd4_readdir() Greg KH
2011-11-02 22:26 ` [075/101] nfsd4: fix seqid_mutating_error Greg KH
2011-11-02 22:27 ` [076/101] nfsd4: ignore WANT bits in open downgrade Greg KH
2011-11-02 22:27 ` [077/101] ASoC: ak4642: fixup cache register table Greg KH
2011-11-02 22:27 ` [078/101] ASoC: ak4535: " Greg KH
2011-11-02 22:27 ` [079/101] KVM: s390: check cpu_id prior to using it Greg KH
2011-11-02 22:27 ` [080/101] [S390] ccwgroup: move attributes to attribute group Greg KH
2011-11-02 22:27 ` [081/101] iommu/amd: Fix wrong shift direction Greg KH
2011-11-02 22:27 ` [082/101] carminefb: Fix module parameters permissions Greg KH
2011-11-02 22:27 ` [083/101] [media] uvcvideo: Set alternate setting 0 on resume if the bus has been reset Greg KH
2011-11-02 22:27 ` [084/101] [media] tuner_xc2028: Allow selection of the frequency adjustment code for XC3028 Greg KH
2011-11-02 22:27 ` [085/101] plat-mxc: iomux-v3.h: implicitly enable pull-up/down when thats desired Greg KH
2011-11-02 22:27 ` [086/101] net: Fix a memmove bug in dev_gro_receive() Greg KH
2011-11-02 22:27 ` [087/101] gro: fix different skb headrooms Greg KH
2011-11-02 22:27 ` [088/101] gro: Re-fix " Greg KH
2011-11-02 22:27 ` [089/101] Revert "MIPS: MTX-1: Make au1000_eth probe all PHY Greg KH
2011-11-02 22:27 ` [090/101] Revert "usb: musb: restore INDEX register in resume path" Greg KH
2011-11-02 22:27 ` [091/101] watchdog: mtx1-wdt: fix build failure Greg KH
2011-11-02 22:27 ` [092/101] kcore: fix test for end of list Greg KH
2011-11-02 22:27 ` [093/101] thinkpad-acpi: module autoloading for newer Lenovo ThinkPads Greg KH
2011-11-02 22:27 ` [094/101] scm: lower SCM_MAX_FD Greg KH
2011-11-02 22:27 ` [095/101] NLM: Dont hang forever on NLM unlock requests Greg KH
2011-11-02 22:27 ` [096/101] Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace Greg KH
2011-11-02 22:27 ` [097/101] vm: fix vm_pgoff wrap in stack expansion Greg KH
2011-11-02 22:27 ` [098/101] vm: fix vm_pgoff wrap in upward expansion Greg KH
2011-11-02 22:27 ` [099/101] Bluetooth: Prevent buffer overflow in l2cap config request Greg KH
2011-11-02 22:27 ` [100/101] nl80211: fix overflow in ssid_len Greg KH
2011-11-02 22:27 ` [101/101] net_sched: Fix qdisc_notify() Greg KH
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=20111102222743.946722537@clark.kroah.org \
--to=gregkh@suse.de \
--cc=JBottomley@Parallels.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mark_salyzyn@us.xyratex.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®