From: Peter Hutterer <peter.hutterer@who-t.net>
To: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] HID: hidraw - add HIDIOCREVOKE ioctl
Date: Wed, 21 Aug 2024 16:59:36 +1000 [thread overview]
Message-ID: <20240821065936.GA635104@quokka> (raw)
In-Reply-To: <nycvar.YFH.7.76.2408210231050.12664@cbobk.fhfr.pm>
Hi Jiri,
On Wed, Aug 21, 2024 at 02:31:32AM +0200, Jiri Kosina wrote:
> On Mon, 12 Aug 2024, Peter Hutterer wrote:
>
> > 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 c7dc65737c9a607d3e6f8478659876074ad129b8 for full details.
> >
> > An MR for systemd-logind has been filed here:
> > https://github.com/systemd/systemd/pull/33970
> >
> > hidraw_is_revoked() and hidraw_open_errno() are both defined as weak
> > functions to allow for a BPF program to deny access to a /dev/hidraw
> > device. The function returns 0 on success or a negative errno
> > otherwise that is returned to the caller.
> >
> > As a use-case example, a gamepad-managing process could attach a BPF
> > program that defaults to -EACCESS for all hidraw devices except those
> > with ID_INPUT_JOYSTICK set by udev.
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
>
> Thanks Peter. Now queued in hid.git#for-6.12/hidraw.
Benjamin just messaged me about a HID CI pipeline failure caused by this
patch, looks like it's buggy. Can you please revert it again? I'll send
out a fixed version ASAP, thanks.
Cheeres,
Peter
next prev parent reply other threads:[~2024-08-21 6:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 10:03 [PATCH v2] HID: hidraw - add HIDIOCREVOKE ioctl Peter Hutterer
2024-08-09 16:43 ` kernel test robot
2024-08-10 3:14 ` kernel test robot
2024-08-12 5:27 ` [PATCH v3] " Peter Hutterer
2024-08-21 0:31 ` Jiri Kosina
2024-08-21 6:59 ` Peter Hutterer [this message]
2024-08-21 12:58 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240821065936.GA635104@quokka \
--to=peter.hutterer@who-t.net \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).