BPF List
 help / color / mirror / Atom feed
* [RFC PATCH] bpf: use bpf_capable() instead of CAP_SYS_ADMIN for blinding decision
@ 2022-08-31  9:06 Yauheni Kaliuta
  2022-08-31 15:24 ` [RFC PATCH v2] " Yauheni Kaliuta
  2022-09-05  9:01 ` [PATCH bpf-next] " Yauheni Kaliuta
  0 siblings, 2 replies; 6+ messages in thread
From: Yauheni Kaliuta @ 2022-08-31  9:06 UTC (permalink / raw)
  To: bpf; +Cc: alexei.starovoitov, jbenc, Yauheni Kaliuta

I'm wodering about the cap check against CAP_SYS_ADMIN. Is it
intentional to provide more security or oversight in commit
2c78ee898d8f ("bpf: Implement CAP_BPF")?

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
---
 include/linux/filter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/filter.h b/include/linux/filter.h
index a5f21dc3c432..3de96b1a736b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -1100,7 +1100,7 @@ static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
 		return false;
 	if (!bpf_jit_harden)
 		return false;
-	if (bpf_jit_harden == 1 && capable(CAP_SYS_ADMIN))
+	if (bpf_jit_harden == 1 && bpf_capable())
 		return false;
 
 	return true;
-- 
2.34.1


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

end of thread, other threads:[~2022-09-16 20:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-31  9:06 [RFC PATCH] bpf: use bpf_capable() instead of CAP_SYS_ADMIN for blinding decision Yauheni Kaliuta
2022-08-31 15:24 ` [RFC PATCH v2] " Yauheni Kaliuta
2022-08-31 18:50   ` Serge E. Hallyn
2022-08-31 21:15     ` Daniel Borkmann
2022-09-05  9:01 ` [PATCH bpf-next] " Yauheni Kaliuta
2022-09-16 20:20   ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox