]> git.baikalelectronics.ru Git - kernel.git/commit
USB: core: Add type-specific length check of BOS descriptors
authorMasakazu Mokuno <masakazu.mokuno@gmail.com>
Thu, 9 Nov 2017 16:25:50 +0000 (01:25 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 14:17:49 +0000 (15:17 +0100)
commit1d0ac9b3dafc7dac1fe793eb38de324765ddd4f5
tree2a887a07dc7d4d7e10d6ee723bb1dce46ed6ac86
parentfb9cbcd3d5d1b007915ef6a6313a370f6530b714
USB: core: Add type-specific length check of BOS descriptors

As most of BOS descriptors are longer in length than their header
'struct usb_dev_cap_header', comparing solely with it is not sufficient
to avoid out-of-bounds access to BOS descriptors.

This patch adds descriptor type specific length check in
usb_get_bos_descriptor() to fix the issue.

Signed-off-by: Masakazu Mokuno <masakazu.mokuno@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/config.c
include/uapi/linux/usb/ch9.h