lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Jun 2014 17:26:22 -0400
From:	Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Jiri Kosina <jkosina@...e.cz>,
	Ping Cheng <pinglinux@...il.com>,
	Jason Gerecke <killertofu@...il.com>
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	linuxwacom-devel@...ts.sourceforge.net
Subject: [PATCH 11/15] HID: uhid: add and set HID_TYPE_UHID for uhid devices

Some wacom devices checks on the .type field of hid_device. However,
uhid never set it, and as a result, we can not use uhid with some of
the wacom tablets.

Create a HID type HID_TYPE_UHID which is set by uhid and taken into
account by wacom.ko.

With this patch, the wacom.ko driver is completely agnostic of the
USB layer, except for the Wireless Receiver. That means that starting
from now, we can check every changes through uhis and comparing the
resulting kernel device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>
---
 drivers/hid/uhid.c               | 2 ++
 drivers/input/tablet/wacom_sys.c | 3 ++-
 include/linux/hid.h              | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index 0cb92e3..6dbe2e0 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -407,6 +407,7 @@ static int uhid_dev_create(struct uhid_device *uhid,
 	hid->country = ev->u.create.country;
 	hid->driver_data = uhid;
 	hid->dev.parent = uhid_misc.this_device;
+	hid->type = HID_TYPE_UHID;
 
 	uhid->hid = hid;
 	uhid->running = true;
@@ -467,6 +468,7 @@ static int uhid_dev_create2(struct uhid_device *uhid,
 	hid->country = ev->u.create2.country;
 	hid->driver_data = uhid;
 	hid->dev.parent = uhid_misc.this_device;
+	hid->type = HID_TYPE_UHID;
 
 	uhid->hid = hid;
 	uhid->running = true;
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 2208b4a..065c6d5 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -1261,7 +1261,8 @@ static int wacom_probe(struct hid_device *hdev,
 		goto fail1;
 	}
 
-	if (features->check_for_hid_type && features->hid_type != hdev->type) {
+	if (hdev->type != HID_TYPE_UHID &&
+	    features->check_for_hid_type && features->hid_type != hdev->type) {
 		error = -ENODEV;
 		goto fail1;
 	}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 9732299..df3c103 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -448,7 +448,8 @@ struct hid_input {
 enum hid_type {
 	HID_TYPE_OTHER = 0,
 	HID_TYPE_USBMOUSE,
-	HID_TYPE_USBNONE
+	HID_TYPE_USBNONE,
+	HID_TYPE_UHID
 };
 
 struct hid_driver;
-- 
2.0.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ