Kconfig 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. config SECURITY_SELINUX
  3. bool "NSA SELinux Support"
  4. depends on SECURITY_NETWORK && AUDIT && NET && INET
  5. select NETWORK_SECMARK
  6. default n
  7. help
  8. This selects NSA Security-Enhanced Linux (SELinux).
  9. You will also need a policy configuration and a labeled filesystem.
  10. If you are unsure how to answer this question, answer N.
  11. config SECURITY_SELINUX_BOOTPARAM
  12. bool "NSA SELinux boot parameter"
  13. depends on SECURITY_SELINUX
  14. default n
  15. help
  16. This option adds a kernel parameter 'selinux', which allows SELinux
  17. to be disabled at boot. If this option is selected, SELinux
  18. functionality can be disabled with selinux=0 on the kernel
  19. command line. The purpose of this option is to allow a single
  20. kernel image to be distributed with SELinux built in, but not
  21. necessarily enabled.
  22. If you are unsure how to answer this question, answer N.
  23. config SECURITY_SELINUX_DISABLE
  24. bool "NSA SELinux runtime disable"
  25. depends on SECURITY_SELINUX
  26. select SECURITY_WRITABLE_HOOKS
  27. default n
  28. help
  29. This option enables writing to a selinuxfs node 'disable', which
  30. allows SELinux to be disabled at runtime prior to the policy load.
  31. SELinux will then remain disabled until the next boot.
  32. This option is similar to the selinux=0 boot parameter, but is to
  33. support runtime disabling of SELinux, e.g. from /sbin/init, for
  34. portability across platforms where boot parameters are difficult
  35. to employ.
  36. NOTE: selecting this option will disable the '__ro_after_init'
  37. kernel hardening feature for security hooks. Please consider
  38. using the selinux=0 boot parameter instead of enabling this
  39. option.
  40. WARNING: this option is deprecated and will be removed in a future
  41. kernel release.
  42. If you are unsure how to answer this question, answer N.
  43. config SECURITY_SELINUX_DEVELOP
  44. bool "NSA SELinux Development Support"
  45. depends on SECURITY_SELINUX
  46. default y
  47. help
  48. This enables the development support option of NSA SELinux,
  49. which is useful for experimenting with SELinux and developing
  50. policies. If unsure, say Y. With this option enabled, the
  51. kernel will start in permissive mode (log everything, deny nothing)
  52. unless you specify enforcing=1 on the kernel command line. You
  53. can interactively toggle the kernel between enforcing mode and
  54. permissive mode (if permitted by the policy) via
  55. /sys/fs/selinux/enforce.
  56. config SECURITY_SELINUX_AVC_STATS
  57. bool "NSA SELinux AVC Statistics"
  58. depends on SECURITY_SELINUX
  59. default y
  60. help
  61. This option collects access vector cache statistics to
  62. /sys/fs/selinux/avc/cache_stats, which may be monitored via
  63. tools such as avcstat.
  64. config SECURITY_SELINUX_CHECKREQPROT_VALUE
  65. int "NSA SELinux checkreqprot default value"
  66. depends on SECURITY_SELINUX
  67. range 0 1
  68. default 0
  69. help
  70. This option sets the default value for the 'checkreqprot' flag
  71. that determines whether SELinux checks the protection requested
  72. by the application or the protection that will be applied by the
  73. kernel (including any implied execute for read-implies-exec) for
  74. mmap and mprotect calls. If this option is set to 0 (zero),
  75. SELinux will default to checking the protection that will be applied
  76. by the kernel. If this option is set to 1 (one), SELinux will
  77. default to checking the protection requested by the application.
  78. The checkreqprot flag may be changed from the default via the
  79. 'checkreqprot=' boot parameter. It may also be changed at runtime
  80. via /sys/fs/selinux/checkreqprot if authorized by policy.
  81. WARNING: this option is deprecated and will be removed in a future
  82. kernel release.
  83. If you are unsure how to answer this question, answer 0.
  84. config SECURITY_SELINUX_SIDTAB_HASH_BITS
  85. int "NSA SELinux sidtab hashtable size"
  86. depends on SECURITY_SELINUX
  87. range 8 13
  88. default 9
  89. help
  90. This option sets the number of buckets used in the sidtab hashtable
  91. to 2^SECURITY_SELINUX_SIDTAB_HASH_BITS buckets. The number of hash
  92. collisions may be viewed at /sys/fs/selinux/ss/sidtab_hash_stats. If
  93. chain lengths are high (e.g. > 20) then selecting a higher value here
  94. will ensure that lookups times are short and stable.
  95. config SECURITY_SELINUX_SID2STR_CACHE_SIZE
  96. int "NSA SELinux SID to context string translation cache size"
  97. depends on SECURITY_SELINUX
  98. default 256
  99. help
  100. This option defines the size of the internal SID -> context string
  101. cache, which improves the performance of context to string
  102. conversion. Setting this option to 0 disables the cache completely.
  103. If unsure, keep the default value.