summaryrefslogtreecommitdiff
path: root/tools/build
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2016-12-09 20:24:24 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-12 10:39:10 (GMT)
commitda4543b3bce001ccc8a283ed64933dea13fb7b77 (patch)
tree57d62fc8349cd2c9b80dac3d568c145a1110168e /tools/build
parent46427c247b6204f95d7406df9f43843306b0b7ab (diff)
downloadlinux-da4543b3bce001ccc8a283ed64933dea13fb7b77.tar.xz
USB: gadgetfs: fix checks of wTotalLength in config descriptors
commit 1c069b057dcf64fada952eaa868d35f02bb0cfc2 upstream. Andrey Konovalov's fuzz testing of gadgetfs showed that we should improve the driver's checks for valid configuration descriptors passed in by the user. In particular, the driver needs to verify that the wTotalLength value in the descriptor is not too short (smaller than USB_DT_CONFIG_SIZE). And the check for whether wTotalLength is too large has to be changed, because the driver assumes there is always enough room remaining in the buffer to hold a device descriptor (at least USB_DT_DEVICE_SIZE bytes). This patch adds the additional check and fixes the existing check. It may do a little more than strictly necessary, but one extra check won't hurt. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/build')
0 files changed, 0 insertions, 0 deletions