Please sign in to comment.
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@example.com> Signed-off-by: Alan Stern <firstname.lastname@example.org> Tested-by: Andrey Konovalov <email@example.com> CC: <firstname.lastname@example.org> Signed-off-by: Greg Kroah-Hartman <email@example.com>
- Loading branch information