lkml.org 
[lkml]   [2019]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] signal/usb: Replace kill_pid_info_as_cred with kill_pid_usb_asyncio
On Tue, 21 May 2019, Eric W. Biederman wrote:

> Alan Stern <stern@rowland.harvard.edu> writes:

> >> req = (struct usb_ctrlrequest *) buf;
> >> req->bRequestType = USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE;
> >> req->bRequest = USB_REQ_GET_DESCRIPTOR;
> >> req->wValue = htole16(USB_DT_DEVICE << 8);
> >> req->wIndex = htole16(0);
> >> req->wLength = htole16(sizeof(buf) - sizeof(*req));
> >
> > In fact, these values are supposed to be in host-endian order, not
> > necessarily little-endian. The USB core converts them if necessary.
>
> Please look again. In include/uapi/linux/ch9.h those fields are
> explicitly defined as little endian and the code in devio.c for
> USBDEVFS_URB_TYPE_CONTROL treats them as little endian. Perhaps there
> is a mismatch here but I haven't seen it and I needed this change to get
> the code to work on big endian.

Oops -- you're right. I was thinking of the USBDEVFS_CONTROL ioctl.
Sorry for the mistake.

Alan Stern

\
 
 \ /
  Last update: 2019-05-21 17:31    [W:0.045 / U:25.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site