Re: [PATCH bpf-next] bpf, capabilities: introduce CAP_BPF

From
Peter Zijlstra <peterz@infradead.org>
Date
2019-08-28 07:15:04
Also in
bpf, linux-security-module, netdev
Reply to
Andy Lutomirski, 2019-08-27
On Tue, Aug 27, 2019 at 04:01:08PM -0700, Andy Lutomirski wrote:
quoted
Tracing:

CAP_BPF and perf_paranoid_tracepoint_raw() (which is kernel.perf_event_paranoid == -1)
are necessary to:
That's not tracing, that's perf.
quoted
+bool cap_bpf_tracing(void)
+{
+       return capable(CAP_SYS_ADMIN) ||
+              (capable(CAP_BPF) && !perf_paranoid_tracepoint_raw());
+}
A whole long time ago, I proposed we introduce CAP_PERF or something
along those lines; as a replacement for that horrible crap Android and
Debian ship. But nobody was ever interested enough.

The nice thing about that is that you can then disallow perf/tracing in
general, but tag the perf executable (and similar tools) with the
capability so that unpriv users can still use it, but only limited
through the tool, not the syscalls directly.
Thread (46 messages) 46 messages, 10 authors, last reply 2019-10-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help