1 # SPDX-License-Identifier: GPL-2.0-only 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 3 # BPF interpreter that, for example, classic s 3 # BPF interpreter that, for example, classic socket filters depend on. 4 config BPF 4 config BPF 5 bool 5 bool 6 select CRYPTO_LIB_SHA1 << 7 6 8 # Used by archs to tell that they support BPF 7 # Used by archs to tell that they support BPF JIT compiler plus which 9 # flavour. Only one of the two can be selected 8 # flavour. Only one of the two can be selected for a specific arch since 10 # eBPF JIT supersedes the cBPF JIT. 9 # eBPF JIT supersedes the cBPF JIT. 11 10 12 # Classic BPF JIT (cBPF) 11 # Classic BPF JIT (cBPF) 13 config HAVE_CBPF_JIT 12 config HAVE_CBPF_JIT 14 bool 13 bool 15 14 16 # Extended BPF JIT (eBPF) 15 # Extended BPF JIT (eBPF) 17 config HAVE_EBPF_JIT 16 config HAVE_EBPF_JIT 18 bool 17 bool 19 18 20 # Used by archs to tell that they want the BPF 19 # Used by archs to tell that they want the BPF JIT compiler enabled by 21 # default for kernels that were compiled with 20 # default for kernels that were compiled with BPF JIT support. 22 config ARCH_WANT_DEFAULT_BPF_JIT 21 config ARCH_WANT_DEFAULT_BPF_JIT 23 bool 22 bool 24 23 25 menu "BPF subsystem" 24 menu "BPF subsystem" 26 25 27 config BPF_SYSCALL 26 config BPF_SYSCALL 28 bool "Enable bpf() system call" 27 bool "Enable bpf() system call" 29 select BPF 28 select BPF 30 select IRQ_WORK 29 select IRQ_WORK 31 select NEED_TASKS_RCU << 32 select TASKS_TRACE_RCU 30 select TASKS_TRACE_RCU 33 select BINARY_PRINTF 31 select BINARY_PRINTF 34 select NET_SOCK_MSG if NET 32 select NET_SOCK_MSG if NET 35 select NET_XGRESS if NET << 36 select PAGE_POOL if NET << 37 default n 33 default n 38 help 34 help 39 Enable the bpf() system call that al 35 Enable the bpf() system call that allows to manipulate BPF programs 40 and maps via file descriptors. 36 and maps via file descriptors. 41 37 42 config BPF_JIT 38 config BPF_JIT 43 bool "Enable BPF Just In Time compiler 39 bool "Enable BPF Just In Time compiler" 44 depends on BPF 40 depends on BPF 45 depends on HAVE_CBPF_JIT || HAVE_EBPF_ 41 depends on HAVE_CBPF_JIT || HAVE_EBPF_JIT 46 select EXECMEM !! 42 depends on MODULES 47 help 43 help 48 BPF programs are normally handled by 44 BPF programs are normally handled by a BPF interpreter. This option 49 allows the kernel to generate native 45 allows the kernel to generate native code when a program is loaded 50 into the kernel. This will significa 46 into the kernel. This will significantly speed-up processing of BPF 51 programs. 47 programs. 52 48 53 Note, an admin should enable this fe 49 Note, an admin should enable this feature changing: 54 /proc/sys/net/core/bpf_jit_enable 50 /proc/sys/net/core/bpf_jit_enable 55 /proc/sys/net/core/bpf_jit_harden 51 /proc/sys/net/core/bpf_jit_harden (optional) 56 /proc/sys/net/core/bpf_jit_kallsyms 52 /proc/sys/net/core/bpf_jit_kallsyms (optional) 57 53 58 config BPF_JIT_ALWAYS_ON 54 config BPF_JIT_ALWAYS_ON 59 bool "Permanently enable BPF JIT and r 55 bool "Permanently enable BPF JIT and remove BPF interpreter" 60 depends on BPF_SYSCALL && HAVE_EBPF_JI 56 depends on BPF_SYSCALL && HAVE_EBPF_JIT && BPF_JIT 61 help 57 help 62 Enables BPF JIT and removes BPF inte 58 Enables BPF JIT and removes BPF interpreter to avoid speculative 63 execution of BPF instructions by the 59 execution of BPF instructions by the interpreter. 64 60 65 When CONFIG_BPF_JIT_ALWAYS_ON is ena << 66 is permanently set to 1 and setting << 67 return failure. << 68 << 69 config BPF_JIT_DEFAULT_ON 61 config BPF_JIT_DEFAULT_ON 70 def_bool ARCH_WANT_DEFAULT_BPF_JIT || 62 def_bool ARCH_WANT_DEFAULT_BPF_JIT || BPF_JIT_ALWAYS_ON 71 depends on HAVE_EBPF_JIT && BPF_JIT 63 depends on HAVE_EBPF_JIT && BPF_JIT 72 64 73 config BPF_UNPRIV_DEFAULT_OFF 65 config BPF_UNPRIV_DEFAULT_OFF 74 bool "Disable unprivileged BPF by defa 66 bool "Disable unprivileged BPF by default" 75 default y << 76 depends on BPF_SYSCALL 67 depends on BPF_SYSCALL 77 help 68 help 78 Disables unprivileged BPF by default 69 Disables unprivileged BPF by default by setting the corresponding 79 /proc/sys/kernel/unprivileged_bpf_di 70 /proc/sys/kernel/unprivileged_bpf_disabled knob to 2. An admin can 80 still reenable it by setting it to 0 71 still reenable it by setting it to 0 later on, or permanently 81 disable it by setting it to 1 (from 72 disable it by setting it to 1 (from which no other transition to 82 0 is possible anymore). 73 0 is possible anymore). 83 << 84 Unprivileged BPF could be used to ex << 85 speculative execution side-channel v << 86 affected hardware. << 87 << 88 If you are unsure how to answer this << 89 74 90 source "kernel/bpf/preload/Kconfig" 75 source "kernel/bpf/preload/Kconfig" 91 76 92 config BPF_LSM 77 config BPF_LSM 93 bool "Enable BPF LSM Instrumentation" 78 bool "Enable BPF LSM Instrumentation" 94 depends on BPF_EVENTS 79 depends on BPF_EVENTS 95 depends on BPF_SYSCALL 80 depends on BPF_SYSCALL 96 depends on SECURITY 81 depends on SECURITY 97 depends on BPF_JIT 82 depends on BPF_JIT 98 help 83 help 99 Enables instrumentation of the secur 84 Enables instrumentation of the security hooks with BPF programs for 100 implementing dynamic MAC and Audit P 85 implementing dynamic MAC and Audit Policies. 101 86 102 If you are unsure how to answer this 87 If you are unsure how to answer this question, answer N. 103 88 104 endmenu # "BPF subsystem" 89 endmenu # "BPF subsystem"
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.