Kconfig 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. #
  2. # Security configuration
  3. #
  4. menu "Security options"
  5. source security/keys/Kconfig
  6. config SECURITY_DMESG_RESTRICT
  7. bool "Restrict unprivileged access to the kernel syslog"
  8. default n
  9. help
  10. This enforces restrictions on unprivileged users reading the kernel
  11. syslog via dmesg(8).
  12. If this option is not selected, no restrictions will be enforced
  13. unless the dmesg_restrict sysctl is explicitly set to (1).
  14. If you are unsure how to answer this question, answer N.
  15. config SECURITY_PERF_EVENTS_RESTRICT
  16. bool "Restrict unprivileged use of performance events"
  17. depends on PERF_EVENTS
  18. help
  19. If you say Y here, the kernel.perf_event_paranoid sysctl
  20. will be set to 3 by default, and no unprivileged use of the
  21. perf_event_open syscall will be permitted unless it is
  22. changed.
  23. config SECURITY
  24. bool "Enable different security models"
  25. depends on SYSFS
  26. depends on MULTIUSER
  27. help
  28. This allows you to choose different security modules to be
  29. configured into your kernel.
  30. If this option is not selected, the default Linux security
  31. model will be used.
  32. If you are unsure how to answer this question, answer N.
  33. config SECURITY_WRITABLE_HOOKS
  34. depends on SECURITY
  35. bool
  36. default n
  37. config SECURITYFS
  38. bool "Enable the securityfs filesystem"
  39. help
  40. This will build the securityfs filesystem. It is currently used by
  41. the TPM bios character driver and IMA, an integrity provider. It is
  42. not used by SELinux or SMACK.
  43. If you are unsure how to answer this question, answer N.
  44. config SECURITY_NETWORK
  45. bool "Socket and Networking Security Hooks"
  46. depends on SECURITY
  47. help
  48. This enables the socket and networking security hooks.
  49. If enabled, a security module can use these hooks to
  50. implement socket and networking access controls.
  51. If you are unsure how to answer this question, answer N.
  52. config PAGE_TABLE_ISOLATION
  53. bool "Remove the kernel mapping in user mode"
  54. default y
  55. depends on (X86_64 || X86_PAE) && !UML
  56. help
  57. This feature reduces the number of hardware side channels by
  58. ensuring that the majority of kernel addresses are not mapped
  59. into userspace.
  60. See Documentation/x86/pti.txt for more details.
  61. config SECURITY_INFINIBAND
  62. bool "Infiniband Security Hooks"
  63. depends on SECURITY && INFINIBAND
  64. help
  65. This enables the Infiniband security hooks.
  66. If enabled, a security module can use these hooks to
  67. implement Infiniband access controls.
  68. If you are unsure how to answer this question, answer N.
  69. config SECURITY_NETWORK_XFRM
  70. bool "XFRM (IPSec) Networking Security Hooks"
  71. depends on XFRM && SECURITY_NETWORK
  72. help
  73. This enables the XFRM (IPSec) networking security hooks.
  74. If enabled, a security module can use these hooks to
  75. implement per-packet access controls based on labels
  76. derived from IPSec policy. Non-IPSec communications are
  77. designated as unlabelled, and only sockets authorized
  78. to communicate unlabelled data can send without using
  79. IPSec.
  80. If you are unsure how to answer this question, answer N.
  81. config SECURITY_PATH
  82. bool "Security hooks for pathname based access control"
  83. depends on SECURITY
  84. help
  85. This enables the security hooks for pathname based access control.
  86. If enabled, a security module can use these hooks to
  87. implement pathname based access controls.
  88. If you are unsure how to answer this question, answer N.
  89. config INTEL_TXT
  90. bool "Enable Intel(R) Trusted Execution Technology (Intel(R) TXT)"
  91. depends on HAVE_INTEL_TXT
  92. help
  93. This option enables support for booting the kernel with the
  94. Trusted Boot (tboot) module. This will utilize
  95. Intel(R) Trusted Execution Technology to perform a measured launch
  96. of the kernel. If the system does not support Intel(R) TXT, this
  97. will have no effect.
  98. Intel TXT will provide higher assurance of system configuration and
  99. initial state as well as data reset protection. This is used to
  100. create a robust initial kernel measurement and verification, which
  101. helps to ensure that kernel security mechanisms are functioning
  102. correctly. This level of protection requires a root of trust outside
  103. of the kernel itself.
  104. Intel TXT also helps solve real end user concerns about having
  105. confidence that their hardware is running the VMM or kernel that
  106. it was configured with, especially since they may be responsible for
  107. providing such assurances to VMs and services running on it.
  108. See <http://www.intel.com/technology/security/> for more information
  109. about Intel(R) TXT.
  110. See <http://tboot.sourceforge.net> for more information about tboot.
  111. See Documentation/intel_txt.txt for a description of how to enable
  112. Intel TXT support in a kernel boot.
  113. If you are unsure as to whether this is required, answer N.
  114. config LSM_MMAP_MIN_ADDR
  115. int "Low address space for LSM to protect from user allocation"
  116. depends on SECURITY && SECURITY_SELINUX
  117. default 32768 if ARM || (ARM64 && COMPAT)
  118. default 65536
  119. help
  120. This is the portion of low virtual memory which should be protected
  121. from userspace allocation. Keeping a user from writing to low pages
  122. can help reduce the impact of kernel NULL pointer bugs.
  123. For most ia64, ppc64 and x86 users with lots of address space
  124. a value of 65536 is reasonable and should cause no problems.
  125. On arm and other archs it should not be higher than 32768.
  126. Programs which use vm86 functionality or have some need to map
  127. this low address space will need the permission specific to the
  128. systems running LSM.
  129. config HAVE_HARDENED_USERCOPY_ALLOCATOR
  130. bool
  131. help
  132. The heap allocator implements __check_heap_object() for
  133. validating memory ranges against heap object sizes in
  134. support of CONFIG_HARDENED_USERCOPY.
  135. config HARDENED_USERCOPY
  136. bool "Harden memory copies between kernel and userspace"
  137. depends on HAVE_HARDENED_USERCOPY_ALLOCATOR
  138. imply STRICT_DEVMEM
  139. help
  140. This option checks for obviously wrong memory regions when
  141. copying memory to/from the kernel (via copy_to_user() and
  142. copy_from_user() functions) by rejecting memory ranges that
  143. are larger than the specified heap object, span multiple
  144. separately allocated pages, are not on the process stack,
  145. or are part of the kernel text. This kills entire classes
  146. of heap overflow exploits and similar kernel memory exposures.
  147. config HARDENED_USERCOPY_FALLBACK
  148. bool "Allow usercopy whitelist violations to fallback to object size"
  149. depends on HARDENED_USERCOPY
  150. default y
  151. help
  152. This is a temporary option that allows missing usercopy whitelists
  153. to be discovered via a WARN() to the kernel log, instead of
  154. rejecting the copy, falling back to non-whitelisted hardened
  155. usercopy that checks the slab allocation size instead of the
  156. whitelist size. This option will be removed once it seems like
  157. all missing usercopy whitelists have been identified and fixed.
  158. Booting with "slab_common.usercopy_fallback=Y/N" can change
  159. this setting.
  160. config HARDENED_USERCOPY_PAGESPAN
  161. bool "Refuse to copy allocations that span multiple pages"
  162. depends on HARDENED_USERCOPY
  163. depends on EXPERT
  164. help
  165. When a multi-page allocation is done without __GFP_COMP,
  166. hardened usercopy will reject attempts to copy it. There are,
  167. however, several cases of this in the kernel that have not all
  168. been removed. This config is intended to be used only while
  169. trying to find such users.
  170. config FORTIFY_SOURCE
  171. bool "Harden common str/mem functions against buffer overflows"
  172. depends on ARCH_HAS_FORTIFY_SOURCE
  173. help
  174. Detect overflows of buffers in common string and memory functions
  175. where the compiler can determine and validate the buffer sizes.
  176. config STATIC_USERMODEHELPER
  177. bool "Force all usermode helper calls through a single binary"
  178. help
  179. By default, the kernel can call many different userspace
  180. binary programs through the "usermode helper" kernel
  181. interface. Some of these binaries are statically defined
  182. either in the kernel code itself, or as a kernel configuration
  183. option. However, some of these are dynamically created at
  184. runtime, or can be modified after the kernel has started up.
  185. To provide an additional layer of security, route all of these
  186. calls through a single executable that can not have its name
  187. changed.
  188. Note, it is up to this single binary to then call the relevant
  189. "real" usermode helper binary, based on the first argument
  190. passed to it. If desired, this program can filter and pick
  191. and choose what real programs are called.
  192. If you wish for all usermode helper programs are to be
  193. disabled, choose this option and then set
  194. STATIC_USERMODEHELPER_PATH to an empty string.
  195. config STATIC_USERMODEHELPER_PATH
  196. string "Path to the static usermode helper binary"
  197. depends on STATIC_USERMODEHELPER
  198. default "/sbin/usermode-helper"
  199. help
  200. The binary called by the kernel when any usermode helper
  201. program is wish to be run. The "real" application's name will
  202. be in the first argument passed to this program on the command
  203. line.
  204. If you wish for all usermode helper programs to be disabled,
  205. specify an empty string here (i.e. "").
  206. config LOCK_DOWN_KERNEL
  207. bool "Allow the kernel to be 'locked down'"
  208. help
  209. Allow the kernel to be locked down under certain circumstances, for
  210. instance if UEFI secure boot is enabled. Locking down the kernel
  211. turns off various features that might otherwise allow access to the
  212. kernel image (eg. setting MSR registers).
  213. config LOCK_DOWN_IN_EFI_SECURE_BOOT
  214. bool "Lock down the kernel in EFI Secure Boot mode"
  215. default n
  216. select LOCK_DOWN_KERNEL
  217. depends on EFI
  218. help
  219. UEFI Secure Boot provides a mechanism for ensuring that the firmware
  220. will only load signed bootloaders and kernels. Secure boot mode may
  221. be determined from EFI variables provided by the system firmware if
  222. not indicated by the boot parameters.
  223. Enabling this option turns on results in kernel lockdown being
  224. triggered if EFI Secure Boot is set.
  225. source security/selinux/Kconfig
  226. source security/smack/Kconfig
  227. source security/tomoyo/Kconfig
  228. source security/apparmor/Kconfig
  229. source security/loadpin/Kconfig
  230. source security/yama/Kconfig
  231. source security/integrity/Kconfig
  232. choice
  233. prompt "Default security module"
  234. default DEFAULT_SECURITY_SELINUX if SECURITY_SELINUX
  235. default DEFAULT_SECURITY_SMACK if SECURITY_SMACK
  236. default DEFAULT_SECURITY_TOMOYO if SECURITY_TOMOYO
  237. default DEFAULT_SECURITY_APPARMOR if SECURITY_APPARMOR
  238. default DEFAULT_SECURITY_DAC
  239. help
  240. Select the security module that will be used by default if the
  241. kernel parameter security= is not specified.
  242. config DEFAULT_SECURITY_SELINUX
  243. bool "SELinux" if SECURITY_SELINUX=y
  244. config DEFAULT_SECURITY_SMACK
  245. bool "Simplified Mandatory Access Control" if SECURITY_SMACK=y
  246. config DEFAULT_SECURITY_TOMOYO
  247. bool "TOMOYO" if SECURITY_TOMOYO=y
  248. config DEFAULT_SECURITY_APPARMOR
  249. bool "AppArmor" if SECURITY_APPARMOR=y
  250. config DEFAULT_SECURITY_DAC
  251. bool "Unix Discretionary Access Controls"
  252. endchoice
  253. config DEFAULT_SECURITY
  254. string
  255. default "selinux" if DEFAULT_SECURITY_SELINUX
  256. default "smack" if DEFAULT_SECURITY_SMACK
  257. default "tomoyo" if DEFAULT_SECURITY_TOMOYO
  258. default "apparmor" if DEFAULT_SECURITY_APPARMOR
  259. default "" if DEFAULT_SECURITY_DAC
  260. endmenu