Kconfig 3.0 KB

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