Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: raw-gadget: do not limit transfer length

Drop the check on the maximum transfer length in Raw Gadget for both
control and non-control transfers.

Limiting the transfer length causes a problem with emulating USB devices
whose full configuration descriptor exceeds PAGE_SIZE in length.

Overall, there does not appear to be any reason to enforce any kind of
transfer length limit on the Raw Gadget side for either control or
non-control transfers, so let's just drop the related check.

Cc: stable <stable@kernel.org>
Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface")
Signed-off-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://patch.msgid.link/a6024e8eab679043e9b8a5defdb41c4bda62f02b.1761085528.git.andreyknvl@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andrey Konovalov and committed by
Greg Kroah-Hartman
37b9dd0d 2bbd38fc

-2
-2
drivers/usb/gadget/legacy/raw_gadget.c
··· 667 667 return ERR_PTR(-EINVAL); 668 668 if (!usb_raw_io_flags_valid(io->flags)) 669 669 return ERR_PTR(-EINVAL); 670 - if (io->length > PAGE_SIZE) 671 - return ERR_PTR(-EINVAL); 672 670 if (get_from_user) 673 671 data = memdup_user(ptr + sizeof(*io), io->length); 674 672 else {