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

2017-12-18 Thread Borissh1983
On 12/5/17, Greg KH  wrote:
> On Tue, Dec 05, 2017 at 10:17:08AM +0200, borissh1...@gmail.com wrote:
>> On Tuesday, 5 December 2017 9:39:33 IST Greg KH wrote:
>> > On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1...@gmail.com 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
>

Thank you , and sorry for the delay.

Using an updated kernel with a specially crafted config values removed
the oops on mass storage devices (debian bugs 878866 and 883345) .

I took usb-linus branch (up to  7a3c296ae08f), I checkedout
git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git and built.
build was done using make deb-config LOCALVERSION=-khan
DEB_PKGVERSION=$(make kernelversion)-1

uname -a
Linux pc 4.15.0-rc3-khan #1 SMP Sun Dec 17 21:00:45 IST 2017 x86_64 GNU/Linux

my usbip config settings are :

grep USBIP /boot/config-4.15.0-rc3-khan
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

Thanks !
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 10:17:08AM +0200, borissh1...@gmail.com wrote:
> On Tuesday, 5 December 2017 9:39:33 IST Greg KH wrote:
> > On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1...@gmail.com 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 
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 
Signed-off-by: Yuyang Du 
Cc: stable 
Acked-by: Shuah Khan 
Signed-off-by: Greg Kroah-Hartman 
---
 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 
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 
Signed-off-by: Shuah Khan 
Cc: stable 
Signed-off-by: Greg Kroah-Hartman 
---
 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) {
+   caseUSB_SPEED_SUPER:
+   if (vhci_driver->idev[i].hub != HUB_SPEED_SUPER)
+   continue;
+   break;
+   default:
+

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

2017-12-05 Thread borissh1983
On Tuesday, 5 December 2017 9:39:33 IST Greg KH wrote:
> On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1...@gmail.com 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 ?

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

> thanks,
> 
> greg k-h

Thanks,
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2017-12-04 Thread Greg KH
On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1...@gmail.com 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?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2017-12-04 Thread borissh1983
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

oops content : 

Kernel failure message 1:
[ cut here ]
invalid opcode:  [#1] SMP
Modules linked in: uas usb_storage bnep btusb btrtl btbcm btintel bluetooth 
drbg ansi_cprng ecdh_generic hid_generic usbhid hid vhci_hcd usbip_core ctr 
ccm snd_hrtimer snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq 
snd_seq_device ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 
nf_nat ipt_REJECT nf_reject_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack 
nf_conntrack libcrc32c cpufreq_conservative cpufreq_userspace iptable_filter 
cpufreq_powersave binfmt_misc arc4 ath5k ath mac80211 snd_hda_codec_hdmi 
snd_hda_codec_realtek cfg80211 snd_hda_codec_generic snd_hda_intel 
snd_hda_codec snd_hda_core powernow_k8 edac_mce_amd snd_hwdep snd_pcm_oss 
kvm_amd snd_mixer_oss kvm snd_pcm acer_wmi pcmcia snd_timer yenta_socket snd 
sparse_keymap rfkill irqbypass pcmcia_rsrc pcmcia_core
 soundcore k8temp pcspkr joydev serio_raw sg ac shpchp battery evdev cuse fuse 
loop parport_pc ppdev lp parport ip_tables x_tables autofs4 ext4 crc16 mbcache 
jbd2 crc32c_generic fscrypto crypto_simd glue_helper cryptd aes_x86_64 ecb cbc 
algif_skcipher af_alg dm_crypt dm_mod sd_mod ohci_pci 8139too psmouse 
ata_generic sdhci_pci sdhci mmc_core 8139cp mii pata_atiixp i2c_piix4 video 
amdkfd ehci_pci ohci_hcd ehci_hcd sata_sil usbcore usb_common wmi radeon 
libata i2c_algo_bit ttm scsi_mod thermal drm_kms_helper drm button
CPU: 1 PID: 1826 Comm: usb-storage Not tainted 4.13.13-falcot #2
Hardware name: Acer Aspire 5100 /Navarro, BIOS V3.13 
08/22/2008
task: 9da063aea240 task.stack: b8c1807cc000
RIP: 0010:vhci_urb_enqueue+0x2d6/0x4b0 [vhci_hcd]
RSP: 0018:b8c1807cfc00 EFLAGS: 00010206
RAX: 0024 RBX: 9da065607000 RCX: 9da065607000
RDX: 0140 RSI: 9da067dc1300 RDI: 9da065607000
RBP: 0002 R08: 0024 R09: 00022618
R10: b8c1807cfcf0 R11: 0112f55f46a0 R12: 9da069a03c00
R13: 0002 R14: 9da067dc1300 R15: 9d9fffbc0098
FS:  () GS:9da06fd0() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 7f07c84ef740 CR3: 00012a062000 CR4: 06e0
Call Trace:
 ? usb_hcd_submit_urb+0xab/0xac0 [usbcore]
 ? __kmalloc+0x1cc/0x5c0
 ? usb_alloc_urb+0x15/0x40 [usbcore]
 ? usb_sg_init+0x99/0x2b0 [usbcore]
 ? usb_sg_wait+0x93/0x170 [usbcore]
 ? usb_stor_bulk_transfer_sglist.part.1+0x63/0xb0 [usb_storage]
 ? usb_stor_bulk_srb+0x49/0x80 [usb_storage]
 ? usb_stor_Bulk_transport+0x163/0x3d0 [usb_storage]
 ? usb_stor_disconnect+0xc0/0xc0 [usb_storage]
 ? usb_stor_invoke_transport+0x37/0x4e0 [usb_storage]
 ? usb_stor_disconnect+0xc0/0xc0 [usb_storage]
 ? wait_for_completion_interruptible+0x145/0x1e0
 ? wait_for_completion_interruptible+0x176/0x1e0
 ? wake_up_q+0x70/0x70
 ? usb_stor_control_thread+0x169/0x280 [usb_storage]
 ? kthread+0x118/0x130
 ? kthread_create_on_node+0x70/0x70
 ? ret_from_fork+0x25/0x30
Code: f1 48 89 fa 48 c7 c6 e0 3c f4 c0 48 c7 c7 90 5f f4 c0 e8 1e e9 23 e1 e9 
7a fd ff ff 41 8b 86 88 00 00 00 85 c0 0f 84 84 fd ff ff <0f> 0b 48 c7 c6 16 
2c f4 c0 4c 89 ff e8 d9 9b 36 e1 4c 89 f6 48 
---[ end trace d94b6115942793e3 ]---


Kernel failure message 2:
[ cut here ]
invalid opcode:  [#1] SMP
Modules linked in: uas usb_storage ctr ccm vhci_hcd usbip_core snd_hrtimer 
snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device 
ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat 
ipt_REJECT nf_reject_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack 
nf_conntrack cpufreq_conservative cpufreq_userspace libcrc32c 
cpufreq_powersave iptable_filter binfmt_misc arc4 ath5k ath mac80211 
snd_hda_codec_hdmi snd_hda_codec_realtek cfg80211 snd_hda_codec_generic 
snd_hda_intel snd_hda_codec powernow_k8 edac_mce_amd kvm_amd snd_hda_core kvm 
snd_hwdep snd_pcm_oss snd_mixer_oss acer_wmi snd_pcm irqbypass sparse_keymap 
rfkill pcmcia joydev k8temp yenta_socket serio_raw pcspkr pcmcia_rsrc 
pcmcia_core snd_timer shpchp snd soundcore sg ac battery evdev cuse fuse loop 
parport_pc
 ppdev lp parport ip_tables x_tables autofs4 ext4 crc16