diff options
| -rw-r--r-- | security/selinux/Kconfig | 37 | ||||
| -rw-r--r-- | security/selinux/include/security.h | 6 |
2 files changed, 42 insertions, 1 deletions
diff --git a/security/selinux/Kconfig b/security/selinux/Kconfig index 814ddc42f1f4..5c64c746b062 100644 --- a/security/selinux/Kconfig +++ b/security/selinux/Kconfig | |||
| @@ -124,3 +124,40 @@ config SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT | |||
| 124 | 124 | ||
| 125 | If you are unsure what do do here, select N. | 125 | If you are unsure what do do here, select N. |
| 126 | 126 | ||
| 127 | config SECURITY_SELINUX_POLICYDB_VERSION_MAX | ||
| 128 | bool "NSA SELinux maximum supported policy format version" | ||
| 129 | depends on SECURITY_SELINUX | ||
| 130 | default n | ||
| 131 | help | ||
| 132 | This option enables the maximum policy format version supported | ||
| 133 | by SELinux to be set to a particular value. This value is reported | ||
| 134 | to userspace via /selinux/policyvers and used at policy load time. | ||
| 135 | It can be adjusted downward to support legacy userland (init) that | ||
| 136 | does not correctly handle kernels that support newer policy versions. | ||
| 137 | |||
| 138 | Examples: | ||
| 139 | For the Fedora Core 3 or 4 Linux distributions, enable this option | ||
| 140 | and set the value via the next option. For Fedore Core 5 and later, | ||
| 141 | do not enable this option. | ||
| 142 | |||
| 143 | If you are unsure how to answer this question, answer N. | ||
| 144 | |||
| 145 | config SECURITY_SELINUX_POLICYDB_VERSION_MAX_VALUE | ||
| 146 | int "NSA SELinux maximum supported policy format version value" | ||
| 147 | depends on SECURITY_SELINUX_POLICYDB_VERSION_MAX | ||
| 148 | range 15 20 | ||
| 149 | default 19 | ||
| 150 | help | ||
| 151 | This option sets the value for the maximum policy format version | ||
| 152 | supported by SELinux. | ||
| 153 | |||
| 154 | Examples: | ||
| 155 | For Fedora Core 3, use 18. | ||
| 156 | For Fedora Core 4, use 19. | ||
| 157 | |||
| 158 | If you are unsure how to answer this question, look for the | ||
| 159 | policy format version supported by your policy toolchain, by | ||
| 160 | running 'checkpolicy -V'. Or look at what policy you have | ||
| 161 | installed under /etc/selinux/$SELINUXTYPE/policy, where | ||
| 162 | SELINUXTYPE is defined in your /etc/selinux/config. | ||
| 163 | |||
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index 911954a692fa..aa21ca1721af 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
| @@ -27,7 +27,11 @@ | |||
| 27 | 27 | ||
| 28 | /* Range of policy versions we understand*/ | 28 | /* Range of policy versions we understand*/ |
| 29 | #define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE | 29 | #define POLICYDB_VERSION_MIN POLICYDB_VERSION_BASE |
| 30 | #define POLICYDB_VERSION_MAX POLICYDB_VERSION_AVTAB | 30 | #ifdef CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX |
| 31 | #define POLICYDB_VERSION_MAX CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX_VALUE | ||
| 32 | #else | ||
| 33 | #define POLICYDB_VERSION_MAX POLICYDB_VERSION_AVTAB | ||
| 34 | #endif | ||
| 31 | 35 | ||
| 32 | extern int selinux_enabled; | 36 | extern int selinux_enabled; |
| 33 | extern int selinux_mls_enabled; | 37 | extern int selinux_mls_enabled; |
