提交 8c1b2119 编写于 作者: M Milan Landaverde 提交者: Alexei Starovoitov

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.netSigned-off-by: NMilan Landaverde <milan@mdaverde.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Acked-by: NQuentin Monnet <quentin@isovalent.com>
Acked-by: NKP Singh <kpsingh@kernel.org>
Link: https://lore.kernel.org/bpf/20220322145012.1315376-1-milan@mdaverde.com
上级 d717e4ca
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册