HID: debug: check length before copy_to_user()
authorDaniel Rosenberg <drosen@google.com>
Mon, 2 Jul 2018 23:59:37 +0000 (16:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jul 2018 14:29:20 +0000 (16:29 +0200)
commit50b4d984f55e7e8d75f75da6803505ca3c122cef
treebeade4fea908c128f169cd0defddbba39e3f79db
parentc1d21fe74c2554f5031f6ceb354ee3ce2ccf475f
HID: debug: check length before copy_to_user()

commit 717adfdaf14704fd3ec7fa2c04520c0723247eac upstream.

If our length is greater than the size of the buffer, we
overflow the buffer

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-debug.c