]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/usb/core/hcd.c
usb: core: Check URB setup_packet and transfer_buffer sanity
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 26 Apr 2017 00:56:11 +0000 (17:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2017 10:20:53 +0000 (12:20 +0200)
commit4568136620c6482bcd4a6b0cd6ae8e5679615d7e
tree0b3033347fe1709138b327b9032b704ee400c53c
parent64b9533ec14bdfb8e77bbe1ae4f4842043d22aeb
usb: core: Check URB setup_packet and transfer_buffer sanity

Update usb_hcd_map_urb_for_dma() to check for an URB's setup_packet and
transfer_buffer sanity. We first check that urb->setup_packet is neither
coming from vmalloc space nor is an on stack buffer, and if that's the
case, produce a warning and return an error. For urb->transfer_buffer
there is an existing is_vmalloc_addr() check so we just supplement that
with an object_is_on_stack() check, produce a warning if that is the case
and also return an error.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd.c