From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 3.8 017/121] USB: fix crash during hotplug of PCI USB controller card
Date: Tue, 17 Jun 2014 09:13:30 -0700 [thread overview]
Message-ID: <1403021714-16320-18-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1403021714-16320-1-git-send-email-kamal@canonical.com>
3.8.13.24 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit a2ff864b53eac9a0e9b05bfe9d1781ccd6c2af71 upstream.
The code in hcd-pci.c that matches up EHCI controllers with their
companion UHCI or OHCI controllers assumes that the private drvdata
fields don't get set too early. However, it turns out that this field
gets set by usb_create_hcd(), before hcd-pci expects it, and this can
result in a crash when two controllers are probed in parallel (as can
happen when a new controller card is hotplugged).
The companions_rwsem lock was supposed to prevent this sort of thing,
but usb_create_hcd() is called outside the scope of the rwsem.
A simple solution is to check that the root-hub pointer has been
initialized as well as the drvdata field. This doesn't happen until
usb_add_hcd() is called; that call and the check are both protected by
the rwsem.
This patch should be applied to stable kernels from 3.10 onward.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Stefani Seibold <stefani@seibold.net>
Tested-by: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
drivers/usb/core/hcd-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 2b487d4..50ebe6c 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -71,7 +71,7 @@ static void companion_common(struct pci_dev *pdev, struct usb_hcd *hcd,
continue;
companion_hcd = pci_get_drvdata(companion);
- if (!companion_hcd)
+ if (!companion_hcd || !companion_hcd->self.root_hub)
continue;
/* For SET_HS_COMPANION, store a pointer to the EHCI bus in
--
1.9.1
next prev parent reply other threads:[~2014-06-17 17:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 16:13 [3.8.y.z extended stable] Linux 3.8.13.24 stable review Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 001/121] ACPI / EC: Clear stale EC events on Samsung systems Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 002/121] ACPI / EC: Process rather than discard events in acpi_ec_clear Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 003/121] mac80211: fix software remain-on-channel implementation Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 004/121] mac80211: exclude AP_VLAN interfaces from tx power calculation Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 005/121] parisc: fix epoll_pwait syscall on compat kernel Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 006/121] ALSA: hda/realtek - Add support of ALC288 codec Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 007/121] user namespace: fix incorrect memory barriers Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 008/121] mlx4_en: don't use napi_synchronize inside mlx4_en_netpoll Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 009/121] mei: ignore client writing state during cb completion Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 010/121] staging: r8712u: Fix case where ethtype was never obtained and always be checked against 0 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 011/121] USB: serial: ftdi_sio: add id for Brainboxes serial cards Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 012/121] Revert "USB: serial: add usbid for dell wwan card to sierra.c" Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 013/121] usb: option driver, add support for Telit UE910v2 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 014/121] USB: cp210x: Add 8281 (Nanotec Plug & Drive) Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 015/121] USB: pl2303: add ids for Hewlett-Packard HP POS pole displays Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 016/121] USB: usb_wwan: fix handling of missing bulk endpoints Kamal Mostafa
2014-06-17 16:13 ` Kamal Mostafa [this message]
2014-06-17 16:13 ` [PATCH 3.8 018/121] USB: cdc-acm: Remove Motorola/Telit H24 serial interfaces from ACM driver Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 019/121] drm/radeon: memory leak on bo reservation failure. v2 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 020/121] drm/radeon/si: make sure mc ucode is loaded before checking the size Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 021/121] mm/hugetlb.c: add cond_resched_lock() in return_unused_surplus_pages() Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 022/121] mm: use paravirt friendly ops for NUMA hinting ptes Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 023/121] iio: querying buffer scan_mask should return 0/1 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 024/121] pata_at91: fix ata_host_activate() failure handling Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 025/121] ext4: note the error in ext4_end_bio() Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 026/121] ext4: fix jbd2 warning under heavy xattr load Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 027/121] ext4: use i_size_read in ext4_unaligned_aio() Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 028/121] locks: allow __break_lease to sleep even when break_time is 0 Kamal Mostafa
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=1403021714-16320-18-git-send-email-kamal@canonical.com \
--to=kamal@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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®