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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211123191238.12472-2-jose.exposito89@gmail.com>
Date:   Tue, 23 Nov 2021 20:12:38 +0100
From:   José Expósito <jose.exposito89@...il.com>
To:     jikos@...nel.org
Cc:     benjamin.tissoires@...hat.com, peter.hutterer@...-t.net,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        José Expósito <jose.exposito89@...il.com>
Subject: [PATCH 1/1] HID: multitouch: only map BTN_LEFT on buttonpads

In addition to map the INPUT_PROP_BUTTONPAD property, make sure that
the BTN_RIGHT and BTN_MIDDLE key bits are not mapped.

Mapping more than one button on buttonpads is a bug plus avoids issues
with some touchpads on user space. For more information, check these
bug reports:

 - https://gitlab.freedesktop.org/libinput/libinput/-/issues/674
 - https://gitlab.freedesktop.org/libinput/libinput/-/issues/689
 - https://gitlab.freedesktop.org/libinput/libinput/-/issues/629

Signed-off-by: José Expósito <jose.exposito89@...il.com>
---
 drivers/hid/hid-multitouch.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index e1afddb7b33d..37697ebe27f9 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1286,8 +1286,11 @@ static int mt_touch_input_configured(struct hid_device *hdev,
 	    (app->buttons_count == 1))
 		td->is_buttonpad = true;
 
-	if (td->is_buttonpad)
+	if (td->is_buttonpad) {
 		__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
+		__clear_bit(BTN_RIGHT, dev->keybit);
+		__clear_bit(BTN_MIDDLE, dev->keybit);
+	}
 
 	app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
 					       BITS_TO_LONGS(td->maxcontacts),
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ