Kconfig 3.1 KB

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