[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1905211129020.1634-100000@iolanthe.rowland.org>
Date: Tue, 21 May 2019 11:30:16 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
cc: linux-usb@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Oliver Neukum <oneukum@...e.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [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@...land.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
Powered by blists - more mailing lists