kernel_optimize_test/drivers/usb/usbip
Nicolas Iooss 238b7bd91b usb: usbip: vudc: fix left shift overflow
In v_recv_cmd_submit(), urb_p->urb->pipe has the type unsigned int
(which is 32-bit long on x86_64) but 11<<30 results in a 34-bit integer.
Therefore the 2 leading bits are truncated and

    urb_p->urb->pipe &= ~(11 << 30);

has the same meaning as

    urb_p->urb->pipe &= ~(3 << 30);

This second statement seems to be how the code was intended to be
written, as PIPE_ constants have values between 0 and 3.

The overflow has been detected with a clang warning:

    drivers/usb/usbip/vudc_rx.c:145:27: warning: signed shift result
    (0x2C0000000) requires 35 bits to represent, but 'int' only has 32
    bits [-Wshift-overflow]
            urb_p->urb->pipe &= ~(11 << 30);
                                  ~~ ^  ~~

Fixes: 79c02cb1fd ("usbip: vudc: Add vudc_rx")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-30 22:28:52 +02:00
..
Kconfig usbip: vhci extension: modifications to vhci driver 2016-08-09 16:21:05 +02:00
Makefile usbip: vudc: Add vudc to Kconfig 2016-04-26 15:19:50 -07:00
README
stub_dev.c usbip: fix NULL pointer dereference on errors 2016-04-28 12:28:08 -07:00
stub_main.c
stub_rx.c usb: usbip: stub_rx: don't print error when allocating urb fails 2016-08-15 15:54:27 +02:00
stub_tx.c usbip: safe completion against unbind operation 2016-04-28 12:28:08 -07:00
stub.h usbip: fix NULL pointer dereference on errors 2016-04-28 12:28:08 -07:00
usbip_common.c usbip: vudc: Make usbip_common vudc-aware 2016-04-26 15:19:50 -07:00
usbip_common.h usbip: don't call stub_device_reset() during stub_disconnect() 2016-06-07 22:18:39 -07:00
usbip_event.c usbip: event handler as one thread 2016-04-19 04:33:15 +09:00
vhci_hcd.c usbip: vhci_hcd: fix return value check in add_platform_device() 2016-08-15 16:25:59 +02:00
vhci_rx.c usbip: vhci extension: modifications to vhci driver 2016-08-09 16:21:05 +02:00
vhci_sysfs.c usbip: vhci extension: modifications to vhci driver 2016-08-09 16:21:05 +02:00
vhci_tx.c usb: usbip: Fix possible deadlocks reported by lockdep 2016-02-03 13:52:10 -08:00
vhci.h usbip: vhci extension: modifications to vhci driver 2016-08-09 16:21:05 +02:00
vudc_dev.c usbip: vudc: Fix apparent cut-n-paste error 2016-08-30 19:06:43 +02:00
vudc_main.c usbip: vudc: Add VUDC main file 2016-04-26 15:19:50 -07:00
vudc_rx.c usb: usbip: vudc: fix left shift overflow 2016-08-30 22:28:52 +02:00
vudc_sysfs.c usb: usbip: remove null check 2016-06-07 22:18:39 -07:00
vudc_transfer.c usb: usbip: vudc: Rename find_endpoint() to vudc_find_endpoint() 2016-04-28 12:28:08 -07:00
vudc_tx.c usbip: vudc: Add vudc_tx 2016-04-26 15:19:50 -07:00
vudc.h usb: usbip: vudc: Rename find_endpoint() to vudc_find_endpoint() 2016-04-28 12:28:08 -07:00

TODO:
	- more discussion about the protocol
	- testing
	- review of the userspace interface
	- document the protocol

Please send patches for this code to Greg Kroah-Hartman <greg@kroah.com>