Re: [PATCH 3/3] usbcore: fix read of usbdevfs_ctrltransfer fields in proc_control()

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

 



On Sat, 31 Aug 2013, Xenia Ragiadakou wrote:

> Urb fields are stored in struct usbdevfs_ctrltransfer in CPU byteorder
> and not in little endian, so there is no need to be converted.
> This bug was reported by sparse.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
> ---
>  drivers/usb/core/devio.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
> index 737e3c1..f4f2300 100644
> --- a/drivers/usb/core/devio.c
> +++ b/drivers/usb/core/devio.c
> @@ -898,10 +898,8 @@ static int proc_control(struct dev_state *ps, void __user *arg)
>  	snoop(&dev->dev, "control urb: bRequestType=%02x "
>  		"bRequest=%02x wValue=%04x "
>  		"wIndex=%04x wLength=%04x\n",
> -		ctrl.bRequestType, ctrl.bRequest,
> -		__le16_to_cpup(&ctrl.wValue),
> -		__le16_to_cpup(&ctrl.wIndex),
> -		__le16_to_cpup(&ctrl.wLength));
> +		ctrl.bRequestType, ctrl.bRequest, ctrl.wValue,
> +		ctrl.wIndex, ctrl.wLength);
>  	if (ctrl.bRequestType & 0x80) {
>  		if (ctrl.wLength && !access_ok(VERIFY_WRITE, ctrl.data,
>  					       ctrl.wLength)) {

Good fix!  The fact that nobody has ever reported a problem here shows 
how little this code gets used.

Alan Stern

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




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

  Powered by Linux