lkml.org 
[lkml]   [2023]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] bpf: lirc program type should not require SYS_CAP_ADMIN
On Thu, Apr 13, 2023 at 1:28 AM Sean Young <sean@mess.org> wrote:
>
> On Wed, Apr 12, 2023 at 04:14:05PM -0700, Alexei Starovoitov wrote:
> > On Tue, Apr 11, 2023 at 8:45 AM Sean Young <sean@mess.org> wrote:
> > >
> > > Make it possible to load lirc program type with just CAP_BPF.
> >
> > Is it safe?
> > If the user can load with just CAP_BPF the FD to the prog and target_fd
> > will allow attach as well.
>
> Exactly, that's the $1m question of course.
>
> I think it's safe from a lirc perspective because you need to be able to
> open the /dev/lirc0 device in the first place; if you can open it, you
> alter all sorts of lirc receiving options already. Changing the IR protocol
> decoder is no different in that perspective.
>
> The other side of course, is it save to load a bpf lirc program as a normal
> user. I don't see any issue with this; I guess this depends on whether the
> subset of functions in lirc_mode2_func_proto() is safe. I am hoping that
> the expert opinion everyone here can help answer that question.

That part is fine under CAP_BPF.
I don't know how lirc devices are typically setup.
If they need root to open them
then why bother relaxing bpf loading part?

\
 
 \ /
  Last update: 2023-04-14 01:55    [W:0.124 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site