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, 31 Jan 2018 11:06:12 +0000 (12:06 +0100)
commitb6f826ba10dce86f74efd3c0953cb9982a3c51e2
tree2a0ecbb1ce1108d74adf4b1ec270a5a42974c464
parent80e733a9b37fb6b40351bf1924d5a90d89c375ae
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