Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54cfa00f authored by Alan Stern's avatar Alan Stern Committed by Gerrit - the friendly Code Review server
Browse files

USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor()

Andrey used the syzkaller fuzzer to find an out-of-bounds memory
access in usb_get_bos_descriptor().  The code wasn't checking that the
next usb_dev_cap_header structure could fit into the remaining buffer
space.

This patch fixes the error and also reduces the bNumDeviceCaps field
in the header to match the actual number of capabilities found, in
cases where there are fewer than expected.

Change-Id: I4dcdbd4d5be97a01a6c3bf9020985c7979c04f29
Git-commit: 1c0edc3633b56000e18d82fc241e3995ca18a69e
Git-repo: https://github.com/torvalds/linux


Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
CC: <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSrinivasa Rao Kuppala <srkupp@codeaurora.org>
parent 32750801
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment