Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

42
What's inside the input stack? Kernel Recipes 2017

Transcript of Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Page 1: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

What's inside the input stack?🐁

Kernel Recipes 2017

Page 2: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

About me:

Benjamin Tissoires (irc: bentiss) • Software engineer at Red Hat • kernel hid-multitouch maintainer, hid core co-maintainer • also gives bad advice for the upper input stack

Page 3: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

About the other guy:

Peter Hutterer (irc: whot) • Software engineer at Red Hat • libinput maintainer • Maintainer of the X.Org input stack, and evdev, synaptics, ... drivers • (99% of the time, 'we' means him and I)

Page 4: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Isn't it working already?

Page 5: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Page 6: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Problem is:hardware makers can be creative

Page 7: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Page 8: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Page 9: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

And usage is changing

Page 10: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires
Page 11: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Outline: • Introduction • Input architecture • Talking about a bunch of devices • A little bit about security

Page 12: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Everything you never wanted toknow about 'how input works'

Page 13: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Components: • Kernel • libinput • "Wayland" or Xorg • toolkit • application

Page 14: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Kernel: • knows about protocols (HID, RMI4, ...) • knows about transport layer (USB, PS/2, SMBus, I2C, etc...) • talks evdev

Page 15: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Libinput: • because input is "easy" • relies on libevdev • does fancy things like gestures • has a global view of the input devices

Page 16: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Compositor (or Xorg): • loads libinput • pass incoming events to the right client

Page 17: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Toolkits: • relies on [see previous slides] • does fancy things like gestures too

Page 18: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Applications: • do something useful (hopefully)

Page 19: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

The good, the bad and the ugly(of input devices)

Page 20: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Keyboards

Page 21: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Page left blank

Page 22: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Actually no...the Caps Lock LED in a TTY isbroken since UTF-8 support inthe kernel

Page 23: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Actually no...the Caps Lock LED in a TTY isbroken since UTF-8 support inthe kernel

pro tip: add /etc/udev/rules.d/99-kbd.rulesACTION=="add", \ SUBSYSTEM=="leds", \ ENV{DEVPATH}=="*/input*::capslock", \ ATTR{trigger}="kbd-ctrlllock"

Page 24: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Mice

Page 25: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

(for the kernel)

Not much to add...

.

Page 26: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

(for the kernel)

Not much to add...

except libratbag

Page 27: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

libratbag:A thing to configure gaming mice

• fun project to hack on • allows for reverse engineering without the pain of breaking the kernel • supports many gaming devices: Logitech, Roccat, G-Skill, Razer (in progress)

Page 28: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Touchpads

Page 29: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Most are still using PS/2

Page 30: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

story time: T440

Page 31: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

story time: T440

Page 32: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

story time: T450

Page 33: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

story time: T450

Page 34: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

A little bit about security(with a red background)

Page 35: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

CVEs?: • yes, but only a few • one notable was regarding the ChromeBook injecting HID event through a web application

Page 36: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

MouseJack

Page 37: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

MouseJack:

Congrats, your mouse is IoT ready!

http://www.mousejack.com/

.

Page 38: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

MouseJack:

Congrats, your mouse is IoT ready!

http://www.mousejack.com/

You have to update it

Page 39: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Summary: • Input architecture • some devices still need some care • security is also involved

Page 40: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Credits • PS/2 keyboard: CC BY Matthijs Kooijman • G600 Gaming Mouse: all rights reserved, Logitech • Lenovo X1 Carbon: CC BY-SA 2.0 Stannate • Lenovo Yoga Tablet 3 Pro: all rights reserved, Lenovo

Page 41: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Thanks!

benjamin.tissoires@(gmail|redhat).comIRC: bentiss @freenode @gimpnet

Page 42: Kernel Recipes 2017 - What's inside the input stack? - Benjamain Tissoires

Summary: • Input architecture • some devices still need some care • security is also involved