Commit graph

4519 commits

Author SHA1 Message Date
Peter Hutterer
3850427cd7 libinput 1.18.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-04-20 13:52:06 +10:00
Peter Hutterer
562157f2a5 evdev: strip the device name of format directives
This fixes a format string vulnerabilty.

evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, which usually and eventually ends up being printf.

If the device name contains a printf-style format directive, these ended
up in the format string and thus get interpreted correctly, e.g. for a
device "Foo%sBar" the log message vs printf invocation ends up being:
  evdev_log_message(device, "some message %s", "some argument");
  printf("event9 - Foo%sBar: some message %s", "some argument");

This can enable an attacker to execute malicious code with the
privileges of the process using libinput.

To exploit this, an attacker needs to be able to create a kernel device
with a malicious name, e.g. through /dev/uinput or a Bluetooth device.

To fix this, convert any potential format directives in the device name
by duplicating percentages.

Pre-rendering the device to avoid the issue altogether would be nicer
but the current log level hooks do not easily allow for this. The device
name is the only user-controlled part of the format string.

A second potential issue is the sysname of the device which is also
sanitized.

This issue was found by Albin Eldstål-Ahrens and Benjamin Svensson from
Assured AB, and independently by Lukas Lamster.

Fixes #752

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit a423d7d326)
2022-04-20 13:44:16 +10:00
Peter Hutterer
7f8113bb88 libinput 1.18.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-08-03 08:56:46 +10:00
satrmb
3a90c008e0 quirks: Chuwi AeroBook Plus has a clickpad falsely claiming to have BTN_RIGHT
Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
(cherry picked from commit 1773973d4d)
2021-08-02 16:45:40 +10:00
Quytelda Kahja
d1704a1f14 Add section for Lenovo Yoga C930 tablet in 50-system-lenovo.quirks.
Fixes #632.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
(cherry picked from commit fc24bba7b3)
2021-08-02 16:45:24 +10:00
Quytelda Kahja
108f580dc1 quirks: Add tablet smoothing attribute.
https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/512 disables
input smoothing for AES devices. However, some AES devices produce
segmented/wobbly curves without smoothing. This change introduces an
`AttrTabletSmoothing` boolean property, which overrides the default smoothing
behavior.

See #632

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
(cherry picked from commit e6c4b1d16e)
2021-08-02 16:45:22 +10:00
Sanjiv
62b10a79b8 Update quirks/50-system-chuwi.quirks
Author:    Sanjiv <sanjerat@gmail.com>
Date:      Wed Jul 28 04:27:56 2021 +0000
Signed-off-by: Sanjiv Erat <sanjerat@gmail.com>
(cherry picked from commit 8ee8537491)
2021-08-02 16:45:15 +10:00
Kevin Anderson
d1571400d6 quirks: add Framework Touchpad Quirk
Handle a bug that the touchpad announces BTN_RIGHT

Signed-off-by: Kevin Anderson <andersonkw2@gmail.com>
(cherry picked from commit eb2ed1863e)
2021-08-02 16:45:14 +10:00
Peter Hutterer
ae2ba96d60 quirks: add a quirk for the X61 bezel buttons
Fixes #628

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 29d311d634)
2021-08-02 16:44:45 +10:00
The_Observer
ecc8cec3f7 quirks: add a quirk for the Purism Librem 14v1
Clickpad that announces BTN_RIGHT
Fixes #629

Signed-off-by: The_Observer <The_Observer@lindemann.space>
(cherry picked from commit 0a354dc16f)
2021-08-02 16:44:43 +10:00
Mohamed Elsharnouby
cb0b88b60b quirks: add pressure range for Dell Latitude 7480
Pressing Ctrl/Shift on this model triggers light touches that causes random clicks.
This doesn't occur on Windows 10 so adding this quirk to fix it

Signed-off-by: sharno <sharnoby3@gmail.com>
(cherry picked from commit 5a23665dfb)
2021-08-02 16:44:42 +10:00
Thomas Stenhouse-Pyne
da1bbce784 quirks: add volume rocker quirk for Lenovo Duet 7i
Signed-off-by: Thomas Stenhouse-Pyne <tommpyne@gmail.com>
(cherry picked from commit 0ddb26a068)
2021-08-02 16:44:40 +10:00
Peter Hutterer
011c7d712e quirks: add a quirk for the Huawei Matebook 2020 touchpad
Clickpad that announces BTN_RIGHT

https://bugzilla.redhat.com/show_bug.cgi?id=1972370

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 17783c24df)
2021-08-02 16:44:32 +10:00
Peter Hutterer
2599b0d899 libinput 1.18.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-02 13:06:37 +10:00
Neev Parikh
a8d450d740 Update 50-system-asus.quirks to include Asus G15 Zephyrus quirk.
Signed-off-by: Neev Parikh <neev.v.parikh@gmail.com>
2021-06-01 11:04:44 -04:00
Peter Hutterer
0432fe59ad libinput 1.17.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-26 13:17:59 +10:00
Peter Hutterer
873a883906 gitlab CI: use FDO_CI_CONCURRENT in our meson build script
Always prefix the ninja args with the FDO_CI_CONCURRENT values (i.e. how many
jobs the runner tells us).

Note that this variable is currently not passed through to the qemu jobs, so
inside the VM we'll still use the ninja default values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-25 11:17:45 +00:00
Peter Hutterer
d09cc9db00 doc/user: #wayland is now on oftc
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-25 20:19:36 +10:00
José Expósito
624041c09b test: cleanup: remove fallthrough followed by break
Remove fallthrough comments followed by a break statement.
No functional changes.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-05-24 05:35:27 +00:00
weizhixiang
1339dbaf3d use more safety list_for_each_safe when remove element in traversing list
Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
2021-05-24 04:42:49 +00:00
weizhixiang
cce5921015 use ARRAY_FOR_EACH when traverse array
Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
2021-05-24 04:11:32 +00:00
satrmb
0cb570addd evdev: restart debouncing timers after every event
Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
2021-05-19 12:24:59 +02:00
novenary
c4ea48eda6 Increase pinch grace period to 300ms
Windows allows "about a third of a second" to trigger a two-finger
pinch.

https://gitlab.freedesktop.org/libinput/libinput/-/issues/550#implementation-in-other-systems

Signed-off-by: novenary <streetwalkermc@gmail.com>
2021-05-19 05:12:58 +00:00
novenary
ca3df8a076 Allow reviving a thumb that moves sufficiently
When pinching, the thumb tends to move slower than the finger, so we may
suppress it too early.

Add a grace period during which it may be revived.

Signed-off-by: novenary <streetwalkermc@gmail.com>
2021-05-19 05:12:58 +00:00
novenary
939a022cbc Improve disambiguation between two-finger pinch and scroll
A pinch is defined as two fingers moving in different directions, and a
scroll as two fingers moving in the same direction.

Often enough when the user is trying to pinch, we may initially see both
fingers moving in the same direction and decide that they want to
scroll.

Add a grace period during which we may transition to a pinch in those
situations.

Test fix: touchpad_trackpoint_buttons_2fg_scroll emits movements that
change the distance between fingers, which triggers this new transition
and makes the test fail; correct this.

Signed-off-by: novenary <streetwalkermc@gmail.com>
2021-05-19 05:12:58 +00:00
dan g
3dcfae3fb6 quirks: add palm rejection support for all Razer Blade models
Generated with a script to scrape the openrazer project for Razer Blade
internal keyboard VIDs, see `razer_quirk_util.py` [1]

This allows us to potentially bulk-add all Razer Blade models to benefit from
palm rejection, rather than processing individual requests and merges.

[1] https://gist.github.com/danryu/ee0c24ac50af40321550462bbf9ab594

Signed-off-by: dan g <dan.garton@gmail.com>
2021-05-19 12:59:18 +10:00
Peter Hutterer
e72b30f424 tools/record: narrow down the obfuscation range
Let a few obvious modifiers through, including the F-key range. Especially
left control is useful to know if it's down.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-18 23:14:44 +00:00
Peter Hutterer
4c82cbd4d0 tools/replay: do not replay key repeat events
The kernel emulates key events on its own anyway, replaying key events with
libinput replay as well just duplicates the events. Turning kernel
repeat off is not an option, it  makes the device look different (EV_REP
changes). So let's just not replay those events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-18 23:14:44 +00:00
Peter Hutterer
5dc000323d gitlab CI: add a JUnit XML report for scan-build
Use a scan-build wrapper to generate plist files, then parse those into a
JUnit xml format. This makes the errors appear on the main MR page as opposed
to being hidden in the artifacts somewhere.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-12 13:31:42 +10:00
Peter Hutterer
b1c9667aca editorconfig: add settings for python files
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-12 11:50:11 +10:00
Peter Hutterer
5a6f141bd8 gitlab CI: bump from Fedora 32 to 34
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-12 10:23:33 +10:00
Peter Hutterer
cf1abf0818 tools/record: add support for hidraw recording
New commandline switch --with-hidraw. This will open all hidraw devices
associated with this device and add any reports to the output in the
form:

  events:
    - hid:
        time: [0, 0]
        hidraw1: [0x01, 0x02, 0x03, 0x05, 0x06]
	hidraw2: [0x07, 0x08, 0x09, 0x0a, 0x0b]
    - evdev:
      ...

i.e. there's a nesting of `hid` with a list of reports, each with the hidraw
node as dictionary entry.

Because hidraw events do not have timestamps and always occur before the evdev
events, they are in a separate frame (as shown above). We could try to figure
out how to match them with the upcoming evdev frame but it's not worth it for
now.

The timestamp itself is a special key in the hidraw with the timestamp from
clock_gettime.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-05 03:59:34 +00:00
Peter Hutterer
f1b16c18e5 meson.build: bump to 1.17.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-05-05 12:46:33 +10:00
Nicolas Fella
20b2123fbc doc/user: Add instructions for using with CMake
CMake provides a nice way to use libinput, let the world now.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-05-04 21:16:55 +02:00
Hans Gaiser
b1f958a178 Add quirk for Lenovo Legion 5 Pro.
Signed-off-by: Hans Gaiser <hansg91@gmail.com>
2021-05-04 00:55:04 +00:00
Peter Hutterer
b38c6ca69f tools/record: linebreak the hid report descriptor every 16 bytes
New output:

 hid: [
    0x05, 0x0d, 0x09, 0x04, 0xa1, 0x01, 0x85, 0x01, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x42, 0x15, 0x00,
    0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x02, 0x75, 0x01, 0x81, 0x03, 0x75, 0x06, 0x09, 0x51,
    0x25, 0x3f, 0x81, 0x02, 0x26, 0xff, 0x00, 0x75, 0x08, 0x09, 0x48, 0x81, 0x02, 0x09, 0x49, 0x81,
    ...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-30 14:54:35 +10:00
Peter Hutterer
7da7cd216f tools/record: print the HID report descriptor as hex
YAML does support hex as long as it's 0x-prefixed. The comment here (probably)
dates from an in-development version of libinput-record that used JSON.
Anyway, let's print the HID report descriptor as hex because that's the common
format for it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-30 14:54:35 +10:00
Peter Hutterer
57811e40f0 tools/record: fix a strlen assumption
We want to be able to print single-character strings.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-30 14:54:35 +10:00
Peter Hutterer
354df8bce9 Change various references to the master branch to main
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-29 01:31:03 +00:00
Peter Hutterer
65c27713cf doc/user: fix a link to the system hwdb file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-29 10:30:49 +10:00
Peter Hutterer
72f747f255 gitlab CI: switch to Ubuntu 21.04
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-23 01:41:12 +00:00
Peter Hutterer
a37d6dcc9c touchpad: if we have a right button, let's assume it's not a clickpad
This assumption dates back roughly a decade when INPUT_PROP_BUTTONPAD was
introduced into the kernel. To my knowledge, devices right now erroneously
advertise INPUT_PROP_BUTTONPAD when they are not a clickpad (but then they
have BTN_RIGHT) or they lack INPUT_PROP_BUTTONPAD (and only have BTN_LEFT).

So let's change our assumption here - if a clickpad has a right button log the
kernel bug and continue with the assumption the device is a touchpad with
physical buttons.

To disable that warning, fix the kernel or add an AttrInputPropDisable quirk
for the device.

Fixes #595

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-21 00:15:42 +00:00
Peter Hutterer
467266bbb4 touchpad: a touchpad with only one button is a clickpad
There is only one touchpad with a physical left button but no right button and
that is the old Apple touchpad, discontinued in 2008. Not a huge number of
those left, I assume.

So let's change our assumptions because these days the vast majority of
touchpads are clickpads - any touchpad that only has a left button is treated
as clickpad, even where the kernel doesn't set the INPUT_PROP_BUTTONPAD.

We do need to check for BTN_LEFT as well though, because Wacom touchpads (i.e.
the touch part of non-integrated Wacom tablets) don't have a left button
either.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-21 00:15:42 +00:00
Peter Hutterer
16d5d78a4d touchpad: use some helper variables to make the code easier to read
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-21 00:15:42 +00:00
Peter Hutterer
f92a388c7a touchpad: factor out clickpad assignment to a helper
No functional changes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-21 00:15:42 +00:00
Udo Rader
144f5ed93d quirks: add quirk for Lenovo Yoga Slim 9 Touchpad
This touchpad is a pressure pad and needs the pressure
handling disabled.

Fixes #604

Signed-off-by: Udo Rader <udo.rader@bestsolution.at>
2021-04-20 02:15:03 +00:00
Peter Hutterer
10124797b5 quirks: add palm size quirk for the Gigabyte Aero 15
Fixes #599

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-14 15:04:39 +10:00
JoseExposito
3565dafdf1 gestures: move the logic to detect gestures to its own function
Move the code in used to detect motion based gestures (scroll, swipe and pinch)
to tp_gesture_detect_motion_gestures.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-04-13 14:01:11 +10:00
JoseExposito
73ef2d70c2 gestures: move up some functions to use them later
Move tp_gesture_same_directions, tp_gesture_mm_moved and tp_gesture_init_pinch
to be able to use them in future commits.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-04-13 14:01:11 +10:00
JoseExposito
020f13e10d gestures: move the code to get raw pointer motion to its own function
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
2021-04-13 14:01:11 +10:00