]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: hidraw: add HIDIOCREVOKE ioctl
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 27 Aug 2024 08:19:29 +0000 (17:19 +0900)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 29 Aug 2024 08:39:37 +0000 (10:39 +0200)
commitb31c9d9dc343146b9f4ce67b4eee748c49296e99
tree012f5d5309ac4ea6e605d5aa7b9ab0363ac2d365
parent6e4436539ae182dc86d57d13849862bcafaa4709
HID: hidraw: add HIDIOCREVOKE ioctl

There is a need for userspace applications to open HID devices directly.
Use-cases include configuration of gaming mice or direct access to
joystick devices. The latter is currently handled by the uaccess tag in
systemd, other devices include more custom/local configurations or just
sudo.

A better approach is what we already have for evdev devices: give the
application a file descriptor and revoke it when it may no longer access
that device.

This patch is the hidraw equivalent to the EVIOCREVOKE ioctl, see
commit c7dc65737c9a ("Input: evdev - add EVIOCREVOKE ioctl") for full
details.

An MR for systemd-logind has been filed here:
https://github.com/systemd/systemd/pull/33970

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Link: https://patch.msgid.link/20240827-hidraw-revoke-v5-1-d004a7451aea@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/hidraw.c
include/linux/hidraw.h
include/uapi/linux/hidraw.h