Re: capable_bpf_net_admin()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 18, 2020 at 3:20 AM Maciej Żenczykowski
<zenczykowski@xxxxxxxxx> wrote:
>
> John has all the details.  I'm just guessing.
>
> But having actually looked at the code, commit 2c78ee898d8f1 ie.
>
> kernel/bpf/syscall.c: bpf_prog_load()
> +       if (is_net_admin_prog_type(type) && !capable(CAP_NET_ADMIN))
> +               return -EPERM;
>
> looks fishy, since our bpfloader only has CHOWN SYS_ADMIN, and the
> maps/programs it creates/loads are used by netd which only has
> NET_ADMIN (but not SYS_ADMIN).  Furthermore I don't really want to
> grant it NET_ADMIN.
>
> I think this should again be either NET_ADMIN or SYS_ADMIN.

Just to confirm, reverting 2c78ee898d8f1 (which doesn't revert
perfectly cleanly) seems to avoid the failure I was seeing.

And specifically in the chunk Maciej pointed out above, if we just
switch the check to CAP_SYS_ADMIN it also avoids the problem.

Let me know if there is anything folks would like me to test!

thanks
-john




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux