diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2017-12-08 17:10:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-08 18:26:34 +0100 |
commit | 5d9b70f7d52eb14bb37861c663bae44de9521c35 (patch) | |
tree | 129fbfdca09d8e39a2887c276a77fa9a5b87ea5d /fs/sysv/Makefile | |
parent | usbip: fix stub_send_ret_submit() vulnerability to null transfer_buffer (diff) | |
download | linux-5d9b70f7d52eb14bb37861c663bae44de9521c35.tar.xz linux-5d9b70f7d52eb14bb37861c663bae44de9521c35.zip |
xhci: Don't add a virt_dev to the devs array before it's fully allocated
Avoid null pointer dereference if some function is walking through the
devs array accessing members of a new virt_dev that is mid allocation.
Add the virt_dev to xhci->devs[i] _after_ the virt_device and all its
members are properly allocated.
issue found by KASAN: null-ptr-deref in xhci_find_slot_id_by_port
"Quick analysis suggests that xhci_alloc_virt_device() is not mutex
protected. If so, there is a time frame where xhci->devs[slot_id] is set
but not fully initialized. Specifically, xhci->devs[i]->udev can be NULL."
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysv/Makefile')
0 files changed, 0 insertions, 0 deletions