OSDN Git Service

usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input
authorShuah Khan <shuahkh@osg.samsung.com>
Thu, 7 Dec 2017 21:16:48 +0000 (14:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:07:16 +0000 (10:07 +0100)
commitf3e957266ae56c200fb13a42309c50f84576c64a
treec497bc1e7f2984f0d9a73f9f55bac88ed7987de0
parentb6dbace92ed744a80af75036e93615324cd27aec
usbip: fix stub_rx: harden CMD_SUBMIT path to handle malicious input

commit c6688ef9f29762e65bce325ef4acd6c675806366 upstream.

Harden CMD_SUBMIT path to handle malicious input that could trigger
large memory allocations. Add checks to validate transfer_buffer_length
and number_of_packets to protect against bad input requesting for
unbounded memory allocations. Validate early in get_pipe() and return
failure.

Reported-by: Secunia Research <vuln@secunia.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/usbip/stub_rx.c