mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
sysctl: Disable bpf() calls from unprivileged users without toggle option
According to the Linux kernel documentation, enabling BPF_UNPRIV_DEFAULT_OFF
(which was done in 69dde418f1) will cause
the sysctl kernel.unprivileged_bpf_disabled to default to 2. This
prohibits calls to bpf() from unprivileged users by default, but allows
for such calls to be allowed again during runtime, by setting
kernel.unprivileged_bpf_disabled to 0.
There is no legitimate reason why this should be possible on IPFire,
which is why this patch sets kernel.unprivileged_bpf_disabled to 1
during startup, causing the same effect as 2, but without any option to
revert this setting during runtime. This fixes a Lynis warning.
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
8709bce6d2
commit
038539d646
@@ -111,3 +111,6 @@ kernel.perf_event_paranoid = 3
|
||||
|
||||
# Only processes with CAP_SYS_PTRACE may use ptrace
|
||||
kernel.yama.ptrace_scope = 2
|
||||
|
||||
# Disable unprivileged calls to bpf() without option to enable during runtime
|
||||
kernel.unprivileged_bpf_disabled = 1
|
||||
|
||||
Reference in New Issue
Block a user