Re: [debian bug:883345] vhci-hcd: kernel oops when attaching a mass storage on client side of usbip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 05, 2017 at 10:17:08AM +0200, borissh1983@xxxxxxxxx wrote:
> On Tuesday, 5 December 2017 9:39:33 IST Greg KH wrote:
> > On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1983@xxxxxxxxx wrote:
> > > Hi ,
> > > 
> > > vhci-hcd kernel oops when attaching a mass storage on 4.13.13.
> > > 
> > > When I try to attach a mass storage device to a vhci-hcd, it generates an
> > > oops. no problem with other devices.
> > > 
> > > A second user had also confirmed on a different hardware ( https://
> > > bugs.debian.org/cgi-bin/bugreport.cgi?bug=878866)
> > > debian's bug report attached bellow.
> > > 
> > > steps to reproduce with debian :
> > > 
> > > On server (debian stable running kernel 4.9) :
> > > 
> > > modprobe usbip-core
> > > modprobe usbip-host
> > > usbipd -D
> > > usbip bind -b bus
> > > 
> > > On client (debian sid running kernel 4.13):
> > > modprobe usbip-core
> > > modprobe vhci-hcd
> > > usbsip attach -b bus -r serverip
> > > 
> > > config values :
> > > 
> > > CONFIG_USBIP_CORE=m
> > > CONFIG_USBIP_VHCI_HCD=m
> > > CONFIG_USBIP_VHCI_HC_PORTS=4
> > > CONFIG_USBIP_VHCI_NR_HCS=8
> > > CONFIG_USBIP_HOST=m
> > > CONFIG_USBIP_VUDC=m
> > 
> > A number of vhci bug fixes have recently been posted to the linux-usb
> > mailing list and will be merged into Linus's tree soon.  Any chance you
> > could test those out to see if it solves your problem or not?
> > 
> 
> Yes , I would gladly check it, just need to understand what I should build and 
> with what options.
> 
> We are talking about git://git.kernel.org/pub/scm/linux/kernel/git/stable/
> linux-stable.git correct ?

No, that does not have the patches in it yet.  If you use the usb.git
tree, in the usb-linus branch, the patches are all there.

Heck, I've just attached them here, as I already have them around, just
try these on top of 4.14.

> And are these usbip config setting correct (should work ) ? 

No idea :)

thanks,

greg k-h
>From 770b2edece42fa55bbe7d4cbe53347a07b8968d4 Mon Sep 17 00:00:00 2001
From: Yuyang Du <yuyang.du@xxxxxxxxx>
Date: Thu, 30 Nov 2017 10:22:40 +0800
Subject: [PATCH 19/22] usbip: Fix USB device hang due to wrong enabling of
 scatter-gather

The previous USB3 SuperSpeed enabling patches mistakenly enabled
URB scatter-gather chaining, which is actually not supported by
the VHCI HCD. This patch fixes that.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197867
Fixes: 03cd00d538a6feb ("usbip: vhci-hcd: Set the vhci structure up to work")
Reported-by: Juan Zea <juan.zea@xxxxxxxxxx>
Signed-off-by: Yuyang Du <yuyang.du@xxxxxxxxx>
Cc: stable <stable@xxxxxxxxxxxxxxx>
Acked-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/usb/usbip/vhci_hcd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index 713e94170963..6b3278c4b72a 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -1098,7 +1098,6 @@ static int hcd_name_to_id(const char *name)
 static int vhci_setup(struct usb_hcd *hcd)
 {
 	struct vhci *vhci = *((void **)dev_get_platdata(hcd->self.controller));
-	hcd->self.sg_tablesize = ~0;
 	if (usb_hcd_is_primary_hcd(hcd)) {
 		vhci->vhci_hcd_hs = hcd_to_vhci_hcd(hcd);
 		vhci->vhci_hcd_hs->vhci = vhci;
-- 
2.15.1

>From 1ac7c8a78be85f84b019d3d2742d1a9f07255cc5 Mon Sep 17 00:00:00 2001
From: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
Date: Wed, 29 Nov 2017 15:24:22 -0700
Subject: [PATCH 20/22] usbip: fix usbip attach to find a port that matches the
 requested speed

usbip attach fails to find a free port when the device on the first port
is a USB_SPEED_SUPER device and non-super speed device is being attached.
It keeps checking the first port and returns without a match getting stuck
in a loop.

Fix it check to find the first port with matching speed.

Reported-by: Juan Zea <juan.zea@xxxxxxxxxx>
Signed-off-by: Shuah Khan <shuahkh@xxxxxxxxxxxxxxx>
Cc: stable <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 tools/usb/usbip/libsrc/vhci_driver.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/tools/usb/usbip/libsrc/vhci_driver.c
index 5727dfb15a83..8a1cd1616de4 100644
--- a/tools/usb/usbip/libsrc/vhci_driver.c
+++ b/tools/usb/usbip/libsrc/vhci_driver.c
@@ -329,9 +329,17 @@ int usbip_vhci_refresh_device_list(void)
 int usbip_vhci_get_free_port(uint32_t speed)
 {
 	for (int i = 0; i < vhci_driver->nports; i++) {
-		if (speed == USB_SPEED_SUPER &&
-		    vhci_driver->idev[i].hub != HUB_SPEED_SUPER)
-			continue;
+
+		switch (speed) {
+		case	USB_SPEED_SUPER:
+			if (vhci_driver->idev[i].hub != HUB_SPEED_SUPER)
+				continue;
+		break;
+		default:
+			if (vhci_driver->idev[i].hub != HUB_SPEED_HIGH)
+				continue;
+		break;
+		}
 
 		if (vhci_driver->idev[i].status == VDEV_ST_NULL)
 			return vhci_driver->idev[i].port;
-- 
2.15.1


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux