Skip to content

Commit 8a03e56

Browse files
pa1guptaborkmann
authored andcommitted
bpf: Disallow unprivileged bpf by default
Disabling unprivileged BPF would help prevent unprivileged users from creating certain conditions required for potential speculative execution side-channel attacks on unmitigated affected hardware. A deep dive on such attacks and current mitigations is available here [0]. Sync with what many distros are currently applying already, and disable unprivileged BPF by default. An admin can enable this at runtime, if necessary, as described in 08389d8 ("bpf: Add kconfig knob for disabling unpriv bpf by default"). [0] "BPF and Spectre: Mitigating transient execution attacks", Daniel Borkmann, eBPF Summit '21 https://ebpf.io/summit-2021-slides/eBPF_Summit_2021-Keynote-Daniel_Borkmann-BPF_and_Spectre.pdf Signed-off-by: Pawan Gupta <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/bpf/0ace9ce3f97656d5f62d11093ad7ee81190c3c25.1635535215.git.pawan.kumar.gupta@linux.intel.com
1 parent f48ad69 commit 8a03e56

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/bpf/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ config BPF_JIT_DEFAULT_ON
6464

6565
config BPF_UNPRIV_DEFAULT_OFF
6666
bool "Disable unprivileged BPF by default"
67+
default y
6768
depends on BPF_SYSCALL
6869
help
6970
Disables unprivileged BPF by default by setting the corresponding
@@ -72,6 +73,12 @@ config BPF_UNPRIV_DEFAULT_OFF
7273
disable it by setting it to 1 (from which no other transition to
7374
0 is possible anymore).
7475

76+
Unprivileged BPF could be used to exploit certain potential
77+
speculative execution side-channel vulnerabilities on unmitigated
78+
affected hardware.
79+
80+
If you are unsure how to answer this question, answer Y.
81+
7582
source "kernel/bpf/preload/Kconfig"
7683

7784
config BPF_LSM

0 commit comments

Comments
 (0)