aboutsummaryrefslogtreecommitdiff
path: root/lib/bug.c
diff options
context:
space:
mode:
authorAlan Stern <[email protected]>2017-10-18 12:49:38 -0400
committerGreg Kroah-Hartman <[email protected]>2017-10-18 19:11:52 +0200
commit1c0edc3633b56000e18d82fc241e3995ca18a69e (patch)
tree41304189ce140630212bfd7640d405579bf38943 /lib/bug.c
parent671632a019853744bc6c0b2ed8bcfdbcea371848 (diff)
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. Reported-by: Andrey Konovalov <[email protected]> Signed-off-by: Alan Stern <[email protected]> Tested-by: Andrey Konovalov <[email protected]> CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'lib/bug.c')
0 files changed, 0 insertions, 0 deletions