Skip to content

Commit e2ced9c

Browse files
mdaverdeNobody
authored andcommitted
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>
1 parent 61a438b commit e2ced9c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/bpf/bpftool/feature.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ static void probe_unprivileged_disabled(void)
207207
printf("bpf() syscall for unprivileged users is enabled\n");
208208
break;
209209
case 1:
210-
printf("bpf() syscall restricted to privileged users\n");
210+
printf("bpf() syscall restricted to privileged users (without recovery)\n");
211+
break;
212+
case 2:
213+
printf("bpf() syscall restricted to privileged users (admin can change)\n");
211214
break;
212215
case -1:
213216
printf("Unable to retrieve required privileges for bpf() syscall\n");

0 commit comments

Comments
 (0)