summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMilan Landaverde <milan@mdaverde.com>2022-03-22 15:49:45 +0100
committerAlexei Starovoitov <ast@kernel.org>2022-03-29 04:01:54 +0200
commit8c1b21198551d795a44f08ad185f716732b47bbe (patch)
tree011355cb0088c63cd08ce86de5812e910f490e22 /tools
parentMerge tag 'net-5.18-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/net... (diff)
downloadlinux-8c1b21198551d795a44f08ad185f716732b47bbe.tar.xz
linux-8c1b21198551d795a44f08ad185f716732b47bbe.zip
bpf/bpftool: Add unprivileged_bpf_disabled check against value of 2
In [1], we added a kconfig knob that can set /proc/sys/kernel/unprivileged_bpf_disabled to 2 We now check against this value in bpftool feature probe [1] https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net Signed-off-by: Milan Landaverde <milan@mdaverde.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Quentin Monnet <quentin@isovalent.com> Acked-by: KP Singh <kpsingh@kernel.org> Link: https://lore.kernel.org/bpf/20220322145012.1315376-1-milan@mdaverde.com
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpftool/feature.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index c2f43a5d38e0..290998c82de1 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -207,7 +207,10 @@ static void probe_unprivileged_disabled(void)
printf("bpf() syscall for unprivileged users is enabled\n");
break;
case 1:
- printf("bpf() syscall restricted to privileged users\n");
+ printf("bpf() syscall restricted to privileged users (without recovery)\n");
+ break;
+ case 2:
+ printf("bpf() syscall restricted to privileged users (admin can change)\n");
break;
case -1:
printf("Unable to retrieve required privileges for bpf() syscall\n");