usbip: fix stub_send_ret_submit() vulnerability to null transfer_buffer
authorShuah Khan <shuahkh@osg.samsung.com>
Thu, 7 Dec 2017 21:16:50 +0000 (14:16 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:24 +0000 (18:32 +0000)
commit41ffa4f1c1480fe4392c6e1c48346a49d048ff4a
treeb1d45727a71d22936edd3a808d0ab7396d9554bb
parent11406025161a8745167414687bca1f8c04b5eb6c
usbip: fix stub_send_ret_submit() vulnerability to null transfer_buffer

commit be6123df1ea8f01ee2f896a16c2b7be3e4557a5a upstream.

stub_send_ret_submit() handles urb with a potential null transfer_buffer,
when it replays a packet with potential malicious data that could contain
a null buffer. Add a check for the condition when actual_length > 0 and
transfer_buffer is null.

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>
[bwh: Backported to 3.2:
 - Device for logging purposes is &sdev->interface->dev
 - Adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/usbip/stub_tx.c