Kconfig 9.8 KB

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