USB: usbip: fix potential out-of-bounds write
authorIgnat Korchagin <ignat.korchagin@gmail.com>
Thu, 17 Mar 2016 18:00:29 +0000 (18:00 +0000)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 11 Jul 2016 03:07:12 +0000 (23:07 -0400)
commit25c871c07f37b8cbaebc97403233185479af095d
tree127f21bb6e55f7dd0b2df888a4e67faa5e0957b5
parentcef12dbf18ab7617cacf7c271da43624afac5520
USB: usbip: fix potential out-of-bounds write

[ Upstream commit b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb ]

Fix potential out-of-bounds write to urb->transfer_buffer
usbip handles network communication directly in the kernel. When receiving a
packet from its peer, usbip code parses headers according to protocol. As
part of this parsing urb->actual_length is filled. Since the input for
urb->actual_length comes from the network, it should be treated as untrusted.
Any entity controlling the network may put any value in the input and the
preallocated urb->transfer_buffer may not be large enough to hold the data.
Thus, the malicious entity is able to write arbitrary data to kernel memory.

Signed-off-by: Ignat Korchagin <ignat.korchagin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/usbip/usbip_common.c