Input: ati_remote2 - fix crashes on detecting device with invalid descriptor
authorVladis Dronov <vdronov@redhat.com>
Wed, 23 Mar 2016 18:53:46 +0000 (11:53 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:05:21 +0000 (00:05 +0200)
commitae211053c771562a27a53c2a49f20f720a7c473d
tree534ce5a65cbd6ead37410011be621d5657e69d1c
parent7fda126c5155acc3e61596ce4c5dcf3859e22444
Input: ati_remote2 - fix crashes on detecting device with invalid descriptor

commit 950336ba3e4a1ffd2ca60d29f6ef386dd2c7351d upstream.

The ati_remote2 driver expects at least two interfaces with one
endpoint each. If given malicious descriptor that specify one
interface or no endpoints, it will crash in the probe function.
Ensure there is at least two interfaces and one endpoint for each
interface before using it.

The full disclosure: http://seclists.org/bugtraq/2016/Mar/90

Reported-by: Ralf Spenneberg <ralf@spenneberg.net>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/input/misc/ati_remote2.c