]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commit
sysctl: Disable bpf() calls from unprivileged users without toggle option
authorPeter Müller <peter.mueller@ipfire.org>
Sun, 16 Jun 2024 14:02:00 +0000 (14:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 2 Jul 2024 09:10:49 +0000 (09:10 +0000)
commit038539d6469b1b15ed3e371a331adbb088cfee51
tree1869c622bec6d04a3ba73a8aa2607168e2062a75
parent8709bce6d23b7d3f692b10398a52907c266810bf
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 69dde418f11dc0085cbe061b90f6c002d6d6cce2) 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>
config/etc/sysctl.conf