]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bpf: lirc program type should not require SYS_CAP_ADMIN
authorSean Young <sean@mess.org>
Mon, 17 Apr 2023 08:17:48 +0000 (09:17 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 17 Apr 2023 20:21:14 +0000 (13:21 -0700)
Make it possible to load lirc program type with just CAP_BPF. There is
nothing exceptional about lirc programs that means they require
SYS_CAP_ADMIN.

In order to attach or detach a lirc program type you need permission to
open /dev/lirc0; if you have permission to do that, you can alter all
sorts of lirc receiving options. Changing the IR protocol decoder is no
different.

Right now on a typical distribution /dev/lirc devices are only
read/write by root. Ideally we would make them group read/write like
other devices so that local users can use them without becoming root.

Signed-off-by: Sean Young <sean@mess.org>
Link: https://lore.kernel.org/r/ZD0ArKpwnDBJZsrE@gofer.mess.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c

index 28eac7434d32b1fa32194ac6852877a0a499894b..bcf1a1920ddd0ad922f53c2bed8c4a23476a8220 100644 (file)
@@ -2454,7 +2454,6 @@ static bool is_net_admin_prog_type(enum bpf_prog_type prog_type)
        case BPF_PROG_TYPE_LWT_SEG6LOCAL:
        case BPF_PROG_TYPE_SK_SKB:
        case BPF_PROG_TYPE_SK_MSG:
-       case BPF_PROG_TYPE_LIRC_MODE2:
        case BPF_PROG_TYPE_FLOW_DISSECTOR:
        case BPF_PROG_TYPE_CGROUP_DEVICE:
        case BPF_PROG_TYPE_CGROUP_SOCK: