Re: Allow ioctl TUNSETIFF without CAP_NET_ADMIN via seccomp?
From: Stanislav Fomichev
Date: Tue Sep 17 2024 - 12:15:03 EST
On 09/17, Zach Walton wrote:
> Thanks, I think this might have been a misunderstanding on my part;
> seccomp is meant to restrict, not expand, permissions. I spent some
> time looking for prior art and see nothing like it.
>
> I will look into alternatives like AppArmor/eBPF. Appreciate the response.
There is a bit of "expand capabilities" prior art in the bind cgroup hooks:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/tree/include/linux/bpf.h#n2075
The BPF program can return special value to ask kernel to not apply
CAP_NET_BIND_SERVICE. But this eBPF hook, not a seccomp..