netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Permissions for eBPF objects
@ 2017-08-25 17:56 Jeffrey Vander Stoep via Selinux
       [not found] ` <CABXk95ATb_AFk+4GX9Xw+HEU6No8irb0mOoLE9O4EBuLAgA-1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Jeffrey Vander Stoep via Selinux @ 2017-08-25 17:56 UTC (permalink / raw)
  To: Chenbo Feng, SELinux, netdev-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 957 bytes --]

I’d like to get your thoughts on adding LSM permission checks on BPF
objects.

By default, the ability to create and use eBPF maps/programs requires
CAP_SYS_ADMIN [1]. Alternatively, all processes can be granted access to
bpf() functions. This seems like poor granularity. [2]

Like files and sockets, eBPF maps and programs can be passed between
processes by FD and have a number of functions that map cleanly to
permissions.

Let me know what you think. Are there simpler alternative approaches that
we haven’t considered?

Thanks!
Jeff

[1] http://man7.org/linux/man-pages/man2/bpf.2.html NOTES section
[2] We are considering eBPF for network filtering by netd. Giving netd
CAP_SYS_ADMIN would considerably increase netd’s privileges. Alternatively
allowing all processes permission to use bpf() goes against the principle
of least privilege exposing a lot of kernel attack surface to processes
that do not actually need it.

[-- Attachment #2: Type: text/html, Size: 1175 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Permissions for eBPF objects
@ 2017-08-25 18:01 Jeffrey Vander Stoep
       [not found] ` <CABXk95AiYO7D8o79TBdt0_0g1TXfULSpL5i7KzHF3R4i-WhwHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2017-08-25 20:04 ` Casey Schaufler
  0 siblings, 2 replies; 15+ messages in thread
From: Jeffrey Vander Stoep @ 2017-08-25 18:01 UTC (permalink / raw)
  To: Chenbo Feng, netdev, SELinux

I’d like to get your thoughts on adding LSM permission checks on BPF objects.

By default, the ability to create and use eBPF maps/programs requires
CAP_SYS_ADMIN [1]. Alternatively, all processes can be granted access
to bpf() functions. This seems like poor granularity. [2]

Like files and sockets, eBPF maps and programs can be passed between
processes by FD and have a number of functions that map cleanly to
permissions.

Let me know what you think. Are there simpler alternative approaches
that we haven’t considered?

Thanks!
Jeff

[1] http://man7.org/linux/man-pages/man2/bpf.2.html NOTES section
[2] We are considering eBPF for network filtering by netd. Giving netd
CAP_SYS_ADMIN would considerably increase netd’s privileges.
Alternatively allowing all processes permission to use bpf() goes
against the principle of least privilege exposing a lot of kernel
attack surface to processes that do not actually need it.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-08-29 22:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25 17:56 Permissions for eBPF objects Jeffrey Vander Stoep via Selinux
     [not found] ` <CABXk95ATb_AFk+4GX9Xw+HEU6No8irb0mOoLE9O4EBuLAgA-1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-25 18:03   ` Jeffrey Vander Stoep via Selinux
  -- strict thread matches above, loose matches on Subject: below --
2017-08-25 18:01 Jeffrey Vander Stoep
     [not found] ` <CABXk95AiYO7D8o79TBdt0_0g1TXfULSpL5i7KzHF3R4i-WhwHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-25 19:26   ` Stephen Smalley
2017-08-25 19:45     ` Jeffrey Vander Stoep
2017-08-25 19:52       ` Chenbo Feng
2017-08-25 20:07         ` Daniel Borkmann
2017-08-26  1:03           ` Alexei Starovoitov
2017-08-29  0:47             ` Chenbo Feng
2017-08-29  1:15               ` Alexei Starovoitov
2017-08-29  1:44                 ` Chenbo Feng
2017-08-29 22:23                   ` Mickaël Salaün
     [not found]         ` <CAMOXUJkQ-Wh==9nzgx3Sq4RUEBK5ArHk4b=AL0N65L9g6cAqcg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-25 20:40           ` Stephen Smalley
2017-08-25 20:49             ` Chenbo Feng
2017-08-25 20:04 ` Casey Schaufler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).