Re: [usb:usb-linus] BUILD REGRESSION c1a145a3ed9a40f3b6145feb97789e8eb49c5566

2019-05-23 Thread Shuah Khan
On 5/23/19 1:13 AM, Greg Kroah-Hartman wrote: On Thu, May 23, 2019 at 01:58:01AM +0800, kbuild test robot wrote: tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus branch HEAD: c1a145a3ed9a40f3b6145feb97789e8eb49c5566 xhci: Use %zu for printing size_t type

[PATCH] usbip: usbip_host: cleanup do_rebind() return path

2019-05-02 Thread Shuah Khan
Cleanup do_rebind() return path and use common return path. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_main.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index bf8a5feb0ee9..2e4bfccd4bfc

[PATCH] selftests: add sleep between detach and usbip list -l

2019-05-02 Thread Shuah Khan
Add a sleep between detach and check for exportable devices to avoid the following segfault from libc-2.27.so [ 6268.136108] usbip[5565]: segfault at 0 ip 7f2a947bddfd sp 7ffd1a8705e8 error 4 in libc-2.27.so[7f2a94703000+1e7000] Signed-off-by: Shuah Khan --- tools/testing/selftests

[PATCH] usbip: Fix vep_free_request() null pointer checks on input args

2019-01-25 Thread Shuah Khan
Fix vep_free_request() to return when usb_ep and usb_request are null instead of calling WARN_ON. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vudc_dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip/vudc_dev.c index

[PATCH v2] usbip: Fix vhci_urb_enqueue() URB null transfer buffer error path

2019-01-24 Thread Shuah Khan
Fix vhci_urb_enqueue() to print debug msg and return error instead of failing with BUG_ON. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index

[PATCH] usbip: Fix vep_free_request() null pointer checks on input args

2019-01-18 Thread Shuah Khan
From: Shuah Khan Fix vep_free_request() to return when usb_ep and usb_request are null instead of calling WARN_ON. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vudc_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/vudc_dev.c b/drivers/usb/usbip

[PATCH] usbip: Fix vhci_urb_enqueue() URB null transfer buffer error path

2019-01-18 Thread Shuah Khan
From: Shuah Khan Fix vhci_urb_enqueue() to print error and return error instead of failing with WARN_ON. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip

Re: [PATCH] usbip: tools: fix atoi() on non-null terminated string

2018-10-25 Thread Shuah Khan
close(fd); > return -1; > } > > - value = atoi(&status); > + value = atoi(status); > > return value; > } > Thanks for the patch. Looks good to me. Acked-by: Shuah Khan thanks, -- Shuah

[PATCH] usbip:vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten

2018-10-18 Thread Shuah Khan (Samsung OSG)
platform_device_del() instead and let put_vudc_device() do the platform_device_put(). Reported-by: Randy Dunlap Signed-off-by: Shuah Khan (Samsung OSG) Cc: --- drivers/usb/usbip/vudc_main.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/usbip

Re: usbip_vudc: BUG kmalloc-2048 (Not tainted): Poison overwritten

2018-10-15 Thread Shuah Khan
On 10/13/2018 11:37 AM, Randy Dunlap wrote: > Kernel 4.19-rc7, on x86_64: > > Load usbip_vudc module, then unload (rmmod) it. > Load it again: > Thanks Randy. I am debugging another problem in this path and I will take a look at this one as well. Just quick ack that I saw this. Thanks for repor

Re: [PATCH] usbip: vhci_hcd: Check rhport everywhere in vhci_hub_control()

2018-10-11 Thread Shuah Khan
Hi Ben, Thanks for the patch. On 10/10/2018 11:30 PM, Ben Hutchings wrote: > Commit 5b22f676118f "usbip: vhci_hcd: check rhport before using in > vhci_hub_control()" added some validation of rhport, but left > several problems: > > - If VHCI_HC_PORTS < 256, we can get rhport >= VHCI_HC_PORTS whi

Re: KASAN: slab-out-of-bounds Read in vhci_hub_control

2018-10-10 Thread Shuah Khan
On 10/10/2018 01:42 PM, Dmitry Vyukov wrote: > On Tue, Oct 2, 2018 at 6:04 PM, Shuah Khan wrote: >> On 09/04/2018 12:52 PM, syzbot wrote: >>> Hello, >>> >>> syzbot found the following crash on: >>> >>> HEAD commit:420f51f4ab6b Merge

Re: [PATCH] usbip: vhci_hcd: check port number before using

2018-10-08 Thread Shuah Khan
On 10/08/2018 02:01 PM, Sudip Mukherjee wrote: > On Mon, Oct 8, 2018 at 8:29 PM Shuah Khan wrote: >> >> Hi Sudip, >> >> On 10/08/2018 01:19 PM, Sudip Mukherjee wrote: >>> From: Sudip Mukherjee >>> >>> The port number is checked and it just

Re: [PATCH] usbip: vhci_hcd: check port number before using

2018-10-08 Thread Shuah Khan
Hi Sudip, On 10/08/2018 01:19 PM, Sudip Mukherjee wrote: > From: Sudip Mukherjee > > The port number is checked and it just prints an error message but it > still continues to use the invalid port. And as a result it accesses > memory which is not its resulting in BUG report from KASAN. Yes th

[PATCH] usb: usbip: Fix BUG: KASAN: slab-out-of-bounds in vhci_hub_control()

2018-10-05 Thread Shuah Khan (Samsung OSG)
reproduce the problem and verify the fix: C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14ed8ab640 Reported-by: syzbot+bccc1fe10b70fadc7...@syzkaller.appspotmail.com Signed-off-by: Shuah Khan (Samsung OSG) --- drivers/usb/usbip/vhci_hcd.c | 57

[PATCH] selftests: usbip: add wait after attach and before checking port status

2018-10-05 Thread Shuah Khan (Samsung OSG)
Add sleep between attach and "usbip port" check to make sure status is updated. Running attach and query back shows incorrect status. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/drivers/usb/usbip/usbip_test.sh | 4 1 file changed, 4 insertions(+) diff --g

Re: KASAN: slab-out-of-bounds Read in vhci_hub_control

2018-10-02 Thread Shuah Khan
On 10/02/2018 10:42 AM, Dmitry Vyukov wrote: > On Tue, Oct 2, 2018 at 6:04 PM, Shuah Khan wrote: >> On 09/04/2018 12:52 PM, syzbot wrote: >>> Hello, >>> >>> syzbot found the following crash on: >>> >>> HEAD commit:420f51f4ab6b Merge

Re: KASAN: slab-out-of-bounds Read in vhci_hub_control

2018-10-02 Thread Shuah Khan
On 09/04/2018 12:52 PM, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:    420f51f4ab6b Merge tag 'arm64-fixes' of git://git.kernel.o.. > git tree:   upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=126a6f0e40 > kernel config:  https://

Re: [PATCH] usbip: fix vhci_hcd controller counting

2018-10-01 Thread Shuah Khan
chine. > > See also: > https://bugzilla.redhat.com/show_bug.cgi?id=1631148 > > Cc: Jonathan Dieter > Cc: Valentina Manea > Cc: Shuah Khan > Cc: linux-usb@vger.kernel.org > Signed-off-by: Maciej Żenczykowski > --- > tools/usb/usbip/libsrc/vhci_driver.c | 2 +- >

Re: WARNING: ODEBUG bug in vudc_probe

2018-09-07 Thread Shuah Khan
On 09/07/2018 10:14 AM, Dmitry Vyukov wrote: > On Fri, Sep 7, 2018 at 6:03 PM, Shuah Khan wrote: >> Hi Dmitry, >> >> On 09/07/2018 04:54 AM, Dmitry Vyukov wrote: >>> Hi, >>> >>> I am getting the following error while booting kernel on upstream >

Re: WARNING: ODEBUG bug in vudc_probe

2018-09-07 Thread Shuah Khan
Hi Dmitry, On 09/07/2018 04:54 AM, Dmitry Vyukov wrote: > Hi, > > I am getting the following error while booting kernel on upstream > commit a49a9dcce802b3651013f659813df1361d306172, config is attached. > Seems there is some kind of resource leak. > > Thanks Odd. This commit has nothing to do w

Re: [PATCH] usbip: Fix misuse of strncpy()

2018-08-09 Thread Shuah Khan
On 07/26/2018 04:39 AM, Ben Hutchings wrote: > On Tue, 2018-07-24 at 11:04 -0600, Shuah Khan wrote: >> On 07/20/2018 08:12 PM, Ben Hutchings wrote: >>> gcc 8 reports: >>> >>> usbip_device_driver.c: In function ‘read_usb_vudc_device’: >>> usbip_devi

Re: [PATCH] usbip: Fix misuse of strncpy()

2018-07-24 Thread Shuah Khan
On 07/20/2018 08:12 PM, Ben Hutchings wrote: > gcc 8 reports: > > usbip_device_driver.c: In function ‘read_usb_vudc_device’: > usbip_device_driver.c:106:2: error: ‘strncpy’ specified bound 256 equals > destination size [-Werror=stringop-truncation] > strncpy(dev->path, path, SYSFS_PATH_MAX); >

Re: [PATCH v3] usbip: dynamically allocate idev by nports found in sysfs

2018-05-23 Thread Shuah Khan
On 05/23/2018 03:22 AM, Michael Grzeschik wrote: > As the amount of available ports varies by the kernels build > configuration. To remove the limitation of the fixed 128 ports > we allocate the amount of idevs by using the number we get > from the kernel. > > Signed-off-by: Michael Grzeschik > -

Re: [PATCH v2] usbip: dynamically allocate idev by nports found in sysfs

2018-05-22 Thread Shuah Khan
On 05/22/2018 11:04 AM, Michael Grzeschik wrote: > As the amount of available ports varies by the kernels build > configuration. To remove the limitation of the fixed 128 ports > we allocate the amount of idevs by using the number we get > from the kernel. > > Signed-off-by: Michael Grzeschik > -

Re: [PATCH] usbip: dynamically allocate idev by nports found in sysfs

2018-05-22 Thread Shuah Khan
Hi Michael, Thanks for the patch. Couple of comments below: On 05/18/2018 08:39 AM, Michael Grzeschik wrote: > As the amount of available ports varies by the kernels build > configuration. To remove the limitation of the fixed 128 ports > we allocate the amount of idevs by using the number we get

Re: [PATCH v3] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-22 Thread Shuah Khan
ed) > +static int valid_args(__u32 *pdev_nr, __u32 *rhport, > + enum usb_device_speed speed) > { > if (!valid_port(pdev_nr, rhport)) { > return 0; > @@ -322,7 +330,7 @@ static ssize_t attach_store(struct device *dev, struct > device_att

Re: [PATCH v2] usbip: vhci_sysfs: fix potential Spectre v1

2018-05-18 Thread Shuah Khan
On 05/18/2018 07:47 AM, Greg Kroah-Hartman wrote: > On Thu, May 17, 2018 at 03:16:28PM -0500, Gustavo A. R. Silva wrote: >> pdev_nr and rhport can be controlled by user-space, hence leading to >> a potential exploitation of the Spectre variant 1 vulnerability. >> >> This issue was detected with the

Re: [PATCH] usbip: usbip_host: fix bad unlock balance during stub_probe()

2018-05-16 Thread Shuah Khan
On 05/15/2018 11:49 PM, Greg KH wrote: > On Tue, May 15, 2018 at 05:57:23PM -0600, Shuah Khan (Samsung OSG) wrote: >> stub_probe() calls put_busid_priv() in an error path when device isn't >> found in the busid_table. Fix it by making put_busid_priv() safe to be >&g

[PATCH] usbip: usbip_host: fix bad unlock balance during stub_probe()

2018-05-15 Thread Shuah Khan (Samsung OSG)
22076557b07c ("usbip: usbip_host: fix NULL-ptr deref and use-after-free errors") in usb-linus Signed-off-by: Shuah Khan (Samsung OSG) --- drivers/usb/usbip/stub_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/

[PATCH] usbip: usbip_host: fix NULL-ptr deref and use-after-free errors

2018-05-14 Thread Shuah Khan (Samsung OSG)
stub_device_rebind() call put_busid_priv() to release the busid lock before returning. This changes fixes the unprotected code paths eliminating the race conditions in updating the busid entries. Signed-off-by: Shuah Khan (Samsung OSG) --- drivers/usb/usbip/stub.h | 2 ++ drivers/usb/usbip

Re: [REBASED PATCH 1/2] usbip: usbip_host: delete device from busid_table after rebind

2018-04-30 Thread Shuah Khan
On 04/30/2018 04:48 PM, Greg KH wrote: > On Mon, Apr 30, 2018 at 04:17:19PM -0600, Shuah Khan (Samsung OSG) wrote: >> Device is left in the busid_table after unbind and rebind. Rebind >> initiates usb bus scan and the original driver claims the device. >> After rescan the dev

[REBASED PATCH 2/2] usbip: usbip_host: run rebind from exit when module is removed

2018-04-30 Thread Shuah Khan (Samsung OSG)
the devices to their original drivers. This includes cleanup changes and moving device_attach() code to a common routine to be called from rebind_store() and usbip_host_exit(). Signed-off-by: Shuah Khan (Samsung OSG) --- drivers/usb/usbip/stub_dev.c | 6 + drivers/usb/usbip/stub_main.c

[REBASED PATCH 1/2] usbip: usbip_host: delete device from busid_table after rebind

2018-04-30 Thread Shuah Khan (Samsung OSG)
. Signed-off-by: Shuah Khan (Samsung OSG) --- drivers/usb/usbip/stub_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index d41d0cdeec0f..fb46bd62d538 100644 --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip

[PATCH 3/3] usbip: usbip_host: run rebind from exit when module is removed

2018-04-11 Thread Shuah Khan
the devices to their original drivers. This includes cleanup changes and moving device_attach() code to a common routine to be called from rebind_store() and usbip_host_exit(). Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_dev.c | 6 + drivers/usb/usbip/stub_main.c | 60

[PATCH 1/3] usbip: usbip_host: refine probe and disconnect debug msgs to be useful

2018-04-11 Thread Shuah Khan
Refine probe and disconnect debug msgs to be useful and say what is in progress. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c index dd8ef36ab10e

[PATCH 2/3] usbip: usbip_host: delete device from busid_table after rebind

2018-04-11 Thread Shuah Khan
. Signed-off-by: Shuah Khan --- drivers/usb/usbip/stub_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index d41d0cdeec0f..fb46bd62d538 100644 --- a/drivers/usb/usbip/stub_main.c +++ b/drivers/usb/usbip/stub_main.c

Re: [PATCH] usbip: vhci_hcd: check rhport before using in vhci_hub_control()

2018-04-06 Thread Shuah Khan
On 04/06/2018 02:01 AM, Sergei Shtylyov wrote: > Hello! > > On 4/6/2018 1:31 AM, Shuah Khan wrote: > >> Validate !rhport < 0 before using it to access port_status array. > >    Why '!'? > I should have explained it better in the commit log. rhport is

[PATCH] usbip: vhci_hcd: check rhport before using in vhci_hub_control()

2018-04-05 Thread Shuah Khan
Validate !rhport < 0 before using it to access port_status array. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 20e3d4609583..d11f3f8dad40 100

[PATCH] usbip: usbip_event: fix to not print kernel pointer address

2018-04-05 Thread Shuah Khan
Fix it to not print kernel pointer address. Remove the conditional and debug message as it isn't very useful. Signed-off-by: Shuah Khan Cc: stable --- drivers/usb/usbip/usbip_event.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/

[PATCH] usbip: usbip_host: fix to hold parent lock for device_attach() calls

2018-04-05 Thread Shuah Khan
usbip_host calls device_attach() without holding dev->parent lock. Fix it. Signed-off-by: Shuah Khan Cc: stable --- drivers/usb/usbip/stub_main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/usb/usbip/stub_main.c b/drivers/usb/usbip/stub_main.c index c31c8402a

Re: [PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-05 Thread Shuah Khan
On 04/05/2018 10:42 AM, Sasha Levin wrote: > Hi. > > [This is an automated email] > > This commit has been processed by the -stable helper bot and determined > to be a high probability candidate for -stable trees. (score: 13.1846) > > The bot has tested the following trees: v4.15.15, v4.14.32, v

Re: [PATCH] usbip: vhci_hcd: Fix usb device and sockfd leaks

2018-04-05 Thread Shuah Khan
On 04/05/2018 10:42 AM, Sasha Levin wrote: > Hi. > > [This is an automated email] > > This commit has been processed by the -stable helper bot and determined > to be a high probability candidate for -stable trees. (score: 10.6103) > > The bot has tested the following trees: v4.15.15, v4.14.32, v

Re: [PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-04 Thread Shuah Khan
On 04/04/2018 02:25 AM, Oliver Neukum wrote: > Am Dienstag, den 03.04.2018, 09:56 -0600 schrieb Shuah Khan: >> This is a virtual device associated to a real physical device on a different >> system. My concern is that if the module gets removed accidentally then it >> could

Re: [PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-03 Thread Shuah Khan
On 04/03/2018 12:56 AM, Greg KH wrote: > On Mon, Apr 02, 2018 at 02:52:31PM -0600, Shuah Khan wrote: >> vhci_hcd module can be removed even when devices are attached. Fix to >> prevent module removal when devices are still attached. >> >> Signed-off-by: Shuah Khan &

Re: [PATCH] usbip: vhci_hcd: Fix usb device and sockfd leaks

2018-04-03 Thread Shuah Khan
On 04/03/2018 12:56 AM, Greg KH wrote: > On Mon, Apr 02, 2018 at 02:52:32PM -0600, Shuah Khan wrote: >> vhci_hcd fails to do reset to put usb device and sockfd in the >> module remove/stop paths. Fix the leak. >> >> Signed-off-by: Shuah Khan > > Should this

[PATCH] usbip: vhci_hcd: Fix usb device and sockfd leaks

2018-04-02 Thread Shuah Khan
vhci_hcd fails to do reset to put usb device and sockfd in the module remove/stop paths. Fix the leak. Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip

[PATCH] usbip: vhc_hcd: prevent module being removed while device are attached

2018-04-02 Thread Shuah Khan
vhci_hcd module can be removed even when devices are attached. Fix to prevent module removal when devices are still attached. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_sysfs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/usb

[PATCH] usbip: tools: usbipd: exclude exported devices from exportable device list

2018-03-21 Thread Shuah Khan
: Shuah Khan --- tools/usb/usbip/src/usbipd.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/usb/usbip/src/usbipd.c b/tools/usb/usbip/src/usbipd.c index f8ff735eb100..32864c52942d 100644 --- a/tools/usb/usbip/src/usbipd.c +++ b/tools/usb/usbip/src/usbipd.c

[PATCH 2/3] usbip: usbip_host_common: Use new error codes to return request status

2018-03-07 Thread Shuah Khan
Currently ST_OK and ST_NA are the only values used to communicate status of a request from a client. Use new error codes to clearly indicate what failed. For example, when client sends request to import a device that isn't export-able, send ST_DEV_BUSY to the client. Signed-off-by: Shuah

[PATCH 1/3] usbip: tools: add more error codes for usbip request/reply messages

2018-03-07 Thread Shuah Khan
lient. Existing defines are moved to a common header in libsrc to be included in the libusbip_la-usbip_common.o to be used by all the usbip tools. Supporting interface to print error strings is added to the common lib. Signed-off-by: Shuah Khan --- tools/usb/usbip/libsrc/usbip_common.c

[PATCH 3/3] usbip: tools: change to use new error codes in server reply messages

2018-03-07 Thread Shuah Khan
) - when a client requests a device that isn't exportable, usbip attach -r server_name -b 3-10.4 usbip: error: Attach Request for 3-10.4 failed - Device not found Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip_attach.c | 11 +-- tools/usb/usbip/src/usbip_list.c

[PATCH 0/3] More error codes for usbip request/reply messages

2018-03-07 Thread Shuah Khan
uest for 3-10.4 failed - Device not found Shuah Khan (3): usbip: tools: add more error codes for usbip request/reply messages usbip: usbip_host_common: Use new error codes to return request status usbip: tools: change to use new error codes in server reply messages tools/usb/usbip/libsrc

Re: [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0

2018-03-06 Thread Shuah Khan
On 03/06/2018 01:35 AM, Salvador Fandiño wrote: > > > On 03/06/2018 01:03 AM, Shuah Khan wrote: >> On 03/05/2018 02:00 AM, Salvador Fandiño wrote: >>> On 02/21/2018 01:35 AM, Shuah Khan wrote: >>>> Hi Salvador, >>>> >>>> On 01/30/

Re: [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0

2018-03-05 Thread Shuah Khan
On 03/05/2018 02:00 AM, Salvador Fandiño wrote: > On 02/21/2018 01:35 AM, Shuah Khan wrote: >> Hi Salvador, >> >> On 01/30/2018 01:36 AM, Salvador Fandino wrote: >>> Let me start by explaining the problem that have motivated me to write >>> this patche

Re: [PATCH] usbip: tools usbip_attach: Fix cryptic error messages

2018-02-27 Thread Shuah Khan
On 02/27/2018 03:45 PM, Krzysztof Opasiak wrote: > > > On 02/27/2018 11:23 PM, Shuah Khan wrote: >> Attach device error message is cryptic and useless. Fix it to be >> informative. >> >> Signed-off-by: Shuah Khan >> --- >>   tools/usb/usbip/src/

[PATCH] usbip: tools usbip_network: Fix cryptic error messages

2018-02-27 Thread Shuah Khan
Kernel and tool version mismatch message is cryptic. Fix it to be informative. Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip_network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/usb/usbip/src/usbip_network.c b/tools/usb/usbip/src/usbip_network.c

[PATCH] usbip: tools usbip_attach: Fix cryptic error messages

2018-02-27 Thread Shuah Khan
Attach device error message is cryptic and useless. Fix it to be informative. Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip_attach.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/usb/usbip/src/usbip_attach.c b/tools/usb/usbip/src/usbip_attach.c index

[PATCH 3.16] staging: usbip stub_rx fix static checker warning on unnecessary checks

2018-02-26 Thread Shuah Khan
sfer_buffer_length > ((~0 >> 1))) => (s32min-s32max > s32max)' drivers/staging/usbip/stub_rx.c:501 stub_recv_cmd_submit() warn: always true condition '(pdu->u.cmd_submit.transfer_buffer_length <= ((~0 >> 1))) => (s32min-s32max <= s32max)' Reported-

Re: [PATCH] usbip: vudc: fix null pointer dereference on udc->lock

2018-02-26 Thread Shuah Khan
we don't have */ > - if (!udc || !udc->driver || !udc->pullup) { > - dev_err(dev, "no device or gadget not bound"); > + if (!udc->driver || !udc->pullup) { > + dev_err(dev, "gadget not bound"); > ret = -

Re: [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0

2018-02-20 Thread Shuah Khan
Hi Salvador, On 01/30/2018 01:36 AM, Salvador Fandino wrote: > Let me start by explaining the problem that have motivated me to write > this patches: > > I work on the QVD, a virtual desktop platform for Linux. This software > runs Linux desktops (i.e. XFCE, KDE) and their applications inside LXC

[PATCH 3.18 4/9] usbip: Fix potential format overflow in userspace tools

2018-02-07 Thread Shuah Khan
arns that these aren't checked with -Wformat-overflow, and with -Werror enabled in configure.ac, that makes these tools unbuildable. This patch fixes these problems by replacing sprintf() with snprintf() in one place and adding checks for the return value of snprintf(). Signed-off-by: Shuah

[PATCH 3.18 0/9] Backports for security and critical bug fixes

2018-02-07 Thread Shuah Khan
): usb: usbip: Fix possible deadlocks reported by lockdep Shuah Khan (8): usbip: fix stub_rx: get_pipe() to validate endpoint number usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input usbip: prevent vhci_hcd driver from leaking a socket pointer address usbip: Fix

[PATCH 3.18 6/9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit

2018-02-07 Thread Shuah Khan
e, leaving device unusable by the client. The device is still attached and however client can't use it. The problem was fixed as part of larger change to add USB3 Super Speed support. This patch isolates the one line fix to clear the USB_PORT_STAT_POWER from the original patch. Signed-off

[PATCH 3.18 1/9] usbip: fix stub_rx: get_pipe() to validate endpoint number

2018-02-07 Thread Shuah Khan
rror instead of calling BUG(). Change caller stub_recv_cmd_submit() to handle the get_pipe() error return. Reported-by: Secunia Research Cc: stable Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_rx.c | 16 ++-- 1 file changed, 10 insertions(

[PATCH 3.18 7/9] usbip: prevent leaking socket pointer address in messages

2018-02-07 Thread Shuah Khan
Upstream commit 90120d15f4c3 ("usbip: prevent leaking socket pointer address in messages") usbip driver is leaking socket pointer address in messages. Remove the messages that aren't useful and print sockfd in the ones that are useful for debugging. Signed-off-by: Shuah Khan Cc:

[PATCH 3.18 5/9] usb: usbip: Fix possible deadlocks reported by lockdep

2018-02-07 Thread Shuah Khan
bug.cgi?id=109351 Signed-off-by: Andrew Goodbody Signed-off-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_event.c | 5 ++- drivers/usb/usbip/vhci_hcd.c| 88 - drivers/usb/usbip/vhci_rx.c | 30 -- drivers

[PATCH 3.18 8/9] usbip: stub: stop printing kernel pointer addresses in messages

2018-02-07 Thread Shuah Khan
Upstream commit 248a22044366 ("usbip: stub: stop printing kernel pointer addresses in messages") Remove and/or change debug, info. and error messages to not print kernel pointer addresses. Signed-off-by: Shuah Khan Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers

[PATCH 3.18 2/9] usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input

2018-02-07 Thread Shuah Khan
bad input requesting for unbounded memory allocations. Validate early in get_pipe() and return failure. Reported-by: Secunia Research Cc: stable Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_rx.c | 30 +++--- 1 file changed, 27

[PATCH 3.18 3/9] usbip: prevent vhci_hcd driver from leaking a socket pointer address

2018-02-07 Thread Shuah Khan
laces socket pointer address with sockfd. Reported-by: Secunia Research Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_common.h | 1 + drivers/usb/usbip/vhci_sysfs.c | 26 +++--- tools/usb/usbip/libsrc/vhci_driver.c | 8 3 files changed, 20 inserti

[PATCH 3.18 9/9] usbip: vhci: stop printing kernel pointer addresses in messages

2018-02-07 Thread Shuah Khan
Upstream commit 8272d099d05f ("usbip: vhci: stop printing kernel pointer addresses in messages") Remove and/or change debug, info. and error messages to not print kernel pointer addresses. Signed-off-by: Shuah Khan Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/

[PATCH 4.4 v2 2/2] usbip: fix 3eee23c3ec14 tcp_socket address still in the status file

2018-02-05 Thread Shuah Khan
et pointer address is not used at the moment and it was made visible as a convenient way to find IP address from socket pointer address by looking up /proc/net/{tcp,tcp6}. As this opens a security hole, the fix replaces socket pointer address with sockfd. Reported-by: Eric Biggers Signed-off-by

[PATCH 4.4 v2 1/2] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit

2018-02-05 Thread Shuah Khan
e, leaving device unusable by the client. The device is still attached and however client can't use it. The problem was fixed as part of larger change to add USB3 Super Speed support. This patch isolates the one line fix to clear the USB_PORT_STAT_POWER from the original patch. Signed-off

[PATCH 4.4 v2 0/2] Backports for fixes

2018-02-05 Thread Shuah Khan
fixed in the first patch in this series masked this bug. With these two fixes, client can use the imported devices on 4.4 Eric Biggers also reported the tcp_socket address still in the status file while I am getting the patch ready. I added him to Reported-by. Shuah Khan (2): usbip: vhci_hcd:

Re: [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0

2018-02-05 Thread Shuah Khan
On 01/30/2018 01:36 AM, Salvador Fandino wrote: > Let me start by explaining the problem that have motivated me to write > this patches: > > I work on the QVD, a virtual desktop platform for Linux. This software > runs Linux desktops (i.e. XFCE, KDE) and their applications inside LXC > containers,

Re: [PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit

2018-01-29 Thread Shuah Khan
On 01/28/2018 05:14 AM, Greg KH wrote: > On Fri, Jan 26, 2018 at 11:54:35AM -0700, Shuah Khan wrote: >> Upstream commit 1c9de5bf4286 ("usbip: vhci-hcd: Add USB3 SuperSpeed >> support") > > Hm, I think you have the wrong commit id here. > > I don't se

[PATCH] usbip: keep usbip_device sockfd state in sync with tcp_socket

2018-01-26 Thread Shuah Khan
Keep usbip_device sockfd state in sync with tcp_socket. When tcp_socket is reset to null, reset sockfd to -1 to keep it in sync. Signed-off-by: Shuah Khan Cc: sta...@vger.kernel.org --- drivers/usb/usbip/stub_dev.c | 3 +++ drivers/usb/usbip/vhci_hcd.c | 2 ++ 2 files changed, 5 insertions

[PATCH 4.4] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit

2018-01-26 Thread Shuah Khan
status file is fixed. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 2 +- drivers/usb/usbip/vhci_sysfs.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 00d68945548e..2d96bfd34138 100644 --

[PATCH 4.9] usbip: vhci_hcd: clear just the USB_PORT_STAT_POWER bit

2018-01-26 Thread Shuah Khan
e, leaving device unusable by the client. The device is still attached and however client can't use it. The problem was fixed as part of larger change to add USB3 Super Speed support. This patch backports just the change to clear the USB_PORT_STAT_POWER. Signed-off-by: Shuah Khan --- dr

[PATCH 4.4 0/4] Backport missing sccurity and deadlock fix

2018-01-25 Thread Shuah Khan
As I started backporting security fixes, I found a deadlock bug that was fixed in a later release. This patch series contains backports for all these problems. Andrew Goodbody (1): usb: usbip: Fix possible deadlocks reported by lockdep Shuah Khan (3): usbip: fix stub_rx: get_pipe() to

[PATCH 4.4 1/4] usb: usbip: Fix possible deadlocks reported by lockdep

2018-01-25 Thread Shuah Khan
bug.cgi?id=109351 Signed-off-by: Andrew Goodbody Signed-off-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_event.c | 5 ++- drivers/usb/usbip/vhci_hcd.c| 88 - drivers/usb/usbip/vhci_rx.c | 30 -- drivers

[PATCH 4.4 2/4] usbip: fix stub_rx: get_pipe() to validate endpoint number

2018-01-25 Thread Shuah Khan
rror instead of calling BUG(). Change caller stub_recv_cmd_submit() to handle the get_pipe() error return. Reported-by: Secunia Research Cc: stable Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_rx.c | 18 +++--- 1 file changed, 11 i

[PATCH 4.4 4/4] usbip: prevent leaking socket pointer address in messages

2018-01-25 Thread Shuah Khan
Upstream commit 90120d15f4c3 ("usbip: prevent leaking socket pointer address in messages") usbip driver is leaking socket pointer address in messages. Remove the messages that aren't useful and print sockfd in the ones that are useful for debugging. Signed-off-by: Shuah Khan Cc:

[PATCH 4.4 3/4] usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input

2018-01-25 Thread Shuah Khan
bad input requesting for unbounded memory allocations. Validate early in get_pipe() and return failure. Reported-by: Secunia Research Cc: stable Signed-off-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/stub_rx.c | 30 +++--- 1 file changed, 27

[PATCH 4.4] usbip: Fix implicit fallthrough warning

2018-01-23 Thread Shuah Khan
that this particular case statement is meant to fall through. Reviewed-by: Peter Senna Tschudin Signed-off-by: Jonathan Dieter Signed-off-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/usb/usbip/src/usbip.c b

[PATCH 4.4] usbip: Fix potential format overflow in userspace tools

2018-01-23 Thread Shuah Khan
arns that these aren't checked with -Wformat-overflow, and with -Werror enabled in configure.ac, that makes these tools unbuildable. This patch fixes these problems by replacing sprintf() with snprintf() in one place and adding checks for the return value of snprintf(). Signed-off-by: Shuah

[PATCH 4.4] usbip: prevent vhci_hcd driver from leaking a socket pointer address

2018-01-23 Thread Shuah Khan
laces socket pointer address with sockfd. Reported-by: Secunia Research Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_common.h | 1 + drivers/usb/usbip/vhci_sysfs.c | 25 +++-- tools/usb/usbip/libsrc/vhci_driver.c | 8 3 files changed, 20 inserti

[PATCH 4.9] usbip: Fix potential format overflow in userspace tools

2018-01-23 Thread Shuah Khan
Reviewed-by: Peter Senna Tschudin Signed-off-by: Jonathan Dieter Acked-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- tools/usb/usbip/libsrc/usbip_common.c | 9 - tools/usb/usbip/libsrc/usbip_host_common.c | 28 +++-

[PATCH 4.9] usbip: Fix implicit fallthrough warning

2018-01-23 Thread Shuah Khan
that this particular case statement is meant to fall through. Reviewed-by: Peter Senna Tschudin Signed-off-by: Jonathan Dieter Signed-off-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/usb/usbip/src/usbip.c b

[PATCH 4.9] usbip: prevent vhci_hcd driver from leaking a socket pointer address

2018-01-23 Thread Shuah Khan
laces socket pointer address with sockfd. Reported-by: Secunia Research Signed-off-by: Shuah Khan --- drivers/usb/usbip/usbip_common.h | 1 + drivers/usb/usbip/vhci_sysfs.c | 25 +++-- tools/usb/usbip/libsrc/vhci_driver.c | 8 3 files changed, 20 inserti

Re: [PATCH 3/6] USB: move many drivers to use DEVICE_ATTR_WO

2018-01-23 Thread Shuah Khan
anks to a script from Joe Perches, this was easily done. > > Reported-by: Joe Perches > Cc: Peter Chen > Cc: Felipe Balbi > Cc: Johan Hovold > Cc: Valentina Manea > Cc: Shuah Khan > Signed-off-by: Greg Kroah-Hartman > --- > drivers/usb/chipidea/o

[PATCH] usbip: vhci_hcd: update 'status' file header and format

2018-01-18 Thread Shuah Khan
Commit 2f2d0088eb93 ("usbip: prevent vhci_hcd driver from leaking a socket pointer address") in the /sys/devices/platform/vhci_hcd/status. Fix the header and field alignment to reflect the changes and make it easier to read. Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_sy

[PATCH 4.9] usbip: fix warning in vhci_hcd_probe/lockdep_init_map

2018-01-17 Thread Shuah Khan
ysfs/group.c:156 [] vhci_start+0x5b4/0x7a0 drivers/usb/usbip/vhci_hcd.c:978 [] usb_add_hcd+0x8da/0x1c60 drivers/usb/core/hcd.c:2867 [] vhci_hcd_probe+0x97/0x130 drivers/usb/usbip/vhci_hcd.c:1103 --- --- ---[ end trace c33c7b202cf3aac8 ]--- Reported-by: Andrey Konovalov Signed-off-by: Shuah Kha

[PATCH] usbip: list: don't list devices attached to vhci_hcd

2018-01-17 Thread Shuah Khan
: sta...@vger.kernel.org Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip_list.c | 9 + 1 file changed, 9 insertions(+) diff --git a/tools/usb/usbip/src/usbip_list.c b/tools/usb/usbip/src/usbip_list.c index f1b38e866dd7..d65a9f444174 100644 --- a/tools/usb/usbip/src/usbip_list.c +++ b

[PATCH] usbip: prevent bind loops on devices attached to vhci_hcd

2018-01-17 Thread Shuah Khan
with accesses via the attached busid result in errors and system hangs during shutdown. Fix it to check and bail out if the device is already attached to vhci_hcd. Cc: sta...@vger.kernel.org Signed-off-by: Shuah Khan --- tools/usb/usbip/src/usbip_bind.c | 9 + 1 file changed, 9 insertions

Re: [PATCH V2] USBIP: return correct port ENABLE status

2018-01-09 Thread Shuah Khan
On 12/18/2017 11:00 PM, pei.zh...@intel.com wrote: > From: Pei Zhang > > USB system will clear port's ENABLE feature for some USB devices when > vdev is already assigned port address. This cause getPortStatus reports > to system that this device is not enabled, client OS will failed to use > this

Re: [PATCH][next] usbip: vhci: fix spelling mistake: "synchronuously" -> "synchronously"

2018-01-04 Thread Shuah Khan
linked %ssynchronously\n", >seqnum, status == -ENOENT ? "" : "a"); > break; > case -EINPROGRESS: > Thanks Colin! Acked-by: Shuah Khan Greg, Please pick this up. thanks, -- Shuah -- To unsubscribe

Re: [PATCH] USB: usbip: remove useless call in usbip_recv

2018-01-02 Thread Shuah Khan
ta_left(&msg); > sock->sk->sk_allocation = GFP_NOIO; > > result = sock_recvmsg(sock, &msg, MSG_WAITALL); > Thanks for the patch. Looks good to me. Acked-by: Shuah Khan Greg, please pick this patch up. thanks, -- Shuah -- To unsubscribe from thi

Re: [PATCH] tools: usb: usbip_device_driver: prefer 'unsigned int' to 'unsigned'

2018-01-02 Thread Shuah Khan
On 12/30/2017 09:11 AM, Elad Wexler wrote: > Fixup a coding style issue > > Signed-off-by: Elad Wexler Thanks for the patch. Looks good to me. Acked-by: Shuah Khan Greg, please pick this patch up. thanks, -- Shuah -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] tools: usb: usbip: fix fd leak in case of 'fread' failure

2018-01-02 Thread Shuah Khan
On 12/30/2017 09:01 AM, Elad Wexler wrote: > Fix possible resource leak: fd > > Signed-off-by: Elad Wexler Thanks for the patch. Looks good to me. Acked-by: Shuah Khan Greg, please pick this patch up. thanks, -- Shuah -- To unsubscribe from this list: send the line "unsubsc

  1   2   3   >