]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: visor: handle potential invalid device configuration
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Apr 2018 15:41:55 +0000 (17:41 +0200)
committerJohan Hovold <johan@kernel.org>
Wed, 2 May 2018 07:37:19 +0000 (09:37 +0200)
commit27b399a680e86356214218ea6bd59fdfe8be3339
tree55a7757f15b2ced167975ae0c8306a032392d4bd
parent2578e16564e13be5c677e25ef4c6c66f4f66caf9
USB: serial: visor: handle potential invalid device configuration

If we get an invalid device configuration from a palm 3 type device, we
might incorrectly parse things, and we have the potential to crash in
"interesting" ways.

Fix this up by verifying the size of the configuration passed to us by
the device, and only if it is correct, will we handle it.

Note that this also fixes an information leak of slab data.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ johan: add comment about the info leak ]
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/visor.c