]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
USB: core: harden cdc_parse_cdc_header
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Sep 2017 14:58:48 +0000 (16:58 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:48:46 +0000 (09:48 -0500)
commit7abe70f205fd8f5d73d059f813fa68d36908f6dc
treeb956e379b4a6b890893ede8627d77fb209495113
parent5b3f55aef2bd1b75782db557a0f82b1ed95cd05d
USB: core: harden cdc_parse_cdc_header

BugLink: http://bugs.launchpad.net/bugs/1723145
commit 2e1c42391ff2556387b3cb6308b24f6f65619feb upstream.

Andrey Konovalov reported a possible out-of-bounds problem for the
cdc_parse_cdc_header function.  He writes:
It looks like cdc_parse_cdc_header() doesn't validate buflen
before accessing buffer[1], buffer[2] and so on. The only check
present is while (buflen > 0).

So fix this issue up by properly validating the buffer length matches
what the descriptor says it is.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/usb/core/message.c