HID: wacom: fix problems when device is not a valid USB device
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 18:35:02 +0000 (19:35 +0100)
committerPDO SCM Team <hudsoncm@motorola.com>
Tue, 14 Jun 2022 07:00:11 +0000 (02:00 -0500)
commitf44793f658ab781552dace3468bf388077f5ee8c
tree50c40d6814a53711fb1628ea099281546f24a97d
parentb6dfe89c4ebfd57f7ecbc3fc4e4c1d63088f2de7
HID: wacom: fix problems when device is not a valid USB device

commit 720ac467204a70308bd687927ed475afb904e11b upstream.

The wacom driver accepts devices of more than just USB types, but some
code paths can cause problems if the device being controlled is not a
USB device due to a lack of checking.  Add the needed checks to ensure
that the USB device accesses are only happening on a "real" USB device,
and not one on some other bus.

Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2022-20132
Bug: 188677105

Change-Id: I6a6db210cb827d262b5301c38f38bffcafed85ab
Cc: Jiri Kosina <j(CR)@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Cc: stable@vger.kernel.org
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20211201183503.2373082-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2276110
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
drivers/hid/wacom_sys.c