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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YoYcw5a6EOvVPzay@kroah.com>
Date:   Thu, 19 May 2022 12:32:35 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Jiri Kosina <jikos@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>, Shuah Khan <shuah@...nel.org>,
        Dave Marchevsky <davemarchevsky@...com>,
        Joe Stringer <joe@...ium.io>, Jonathan Corbet <corbet@....net>,
        Tero Kristo <tero.kristo@...ux.intel.com>,
        linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH bpf-next v5 00/17] Introduce eBPF support for HID devices

On Thu, May 19, 2022 at 01:38:58AM -0700, Christoph Hellwig wrote:
> On Thu, May 19, 2022 at 10:20:35AM +0200, Greg KH wrote:
> > > are written using a hip new VM?
> > 
> > Ugh, don't mention UDI, that's a bad flashback...
> 
> But that is very much what we are doing here.
> 
> > I thought the goal here was to move a lot of the quirk handling and
> > "fixup the broken HID decriptors in this device" out of kernel .c code
> > and into BPF code instead, which this patchset would allow.
> > 
> > So that would just be exception handling.  I don't think you can write a
> > real HID driver here at all, but I could be wrong as I have not read the
> > new patchset (older versions of this series could not do that.)
> 
> And that "exception handling" is most of the driver.

For a number of "small" drivers, yes, that's all there is as the
hardware is "broken" and needs to be fixed up in order to work properly
with the hid core code.  An example of that would be hid-samsung.c which
rewrites the descriptors to be sane and maps the mouse buttons properly.

But that's it, after initialization that driver gets out of the way and
doesn't actually control anything.  From what I can tell, this patchset
would allow us to write those "fixup the mappings and reports before the
HID driver takes over" into ebpf programs.

It would not replace "real" HID drivers like hid-rmi.c that has to
handle the events and do other "real" work here.

Or I could be reading this code all wrong, Benjamin?

But even if it would allow us to write HID drivers as ebpf, what is
wrong with that?  It's not a licensing issue (this api is only allowed
for GPL ebpf programs), it should allow us to move a bunch of in-kernel
drivers into smaller ebpf programs instead.

It's not like this ebpf HID driver would actually work on any other
operating system, right?  I guess Microsoft could create a gpl-licensed
ebpf HID layer as well?  As Windows allows vendors to do all of this
horrible HID fixups in userspace today anyway, I strongly doubt they
would go through the effort to add a new api like this for no valid
reason.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ