Skip to contentSkip to conversation

selinux(8): explain that runtime disable is deprecated

PATCH In review Ondrej Mosnacek 3 participants 4 messages Nov 11, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selinux(8): explain that runtime disable is deprecated

Update the main SELinux manpage to explain that runtime disable (i.e. disabling SELinux using SELINUX=Disabled) is deprecated and recommend disabling SELinux only via the kernel boot parameter.

---
 libselinux/man/man8/selinux.8 | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
libselinux/man/man8/selinux.8 +22 -4
index 31364271..721a65f4 100644
@@ -19,12 +19,12 @@ enabled or disabled, and if enabled, whether SELinux operates in
 permissive mode or enforcing mode.  The
 .B SELINUX
 variable may be set to
-any one of disabled, permissive, or enforcing to select one of these
-options.  The disabled option completely disables the SELinux kernel
+any one of Disabled, Permissive, or Enforcing to select one of these
+options.  The Disabled option completely disables the SELinux kernel
 and application code, leaving the system running without any SELinux
-protection.  The permissive option enables the SELinux code, but
+protection.  The Permissive option enables the SELinux code, but
 causes it to operate in a mode where accesses that would be denied by
-policy are permitted but audited.  The enforcing option enables the
+policy are permitted but audited.  The Enforcing option enables the
 SELinux code and causes it to enforce access denials as well as
 auditing them.  Permissive mode may yield a different set of denials
 than enforcing mode, both because enforcing mode will prevent an
@@ -32,6 +32,24 @@ operation from proceeding past the first denial and because some
 application code will fall back to a less privileged mode of operation
 if denied access.
 
+.B NOTE:
+Disabling SELinux by setting
+.B SELINUX=Disabled
+in
+.I /etc/selinux/config
+is deprecated and depending on kernel version and configuration it might
+not lead to SELinux being completely disabled.  Specifically, the
+SELinux hooks will still be executed internally, but the SELinux policy
+will not be loaded and no operation will be denied.  In such state, the
+system will act as if SELinux was disabled, although some operations
+might behave slightly differently.  To properly disable SELinux, it is
+recommended to use the
+.B selinux=0
+kernel boot option instead.  In that case SELinux will be disabled
+regardless of what is set in the
+.I /etc/selinux/config
+file.
+
 The
 .I /etc/selinux/config
 configuration file also controls what policy
Signature · 1 line
2.26.2
#1 lore raw
Quoted 14 lines · Ondrej Mosnacek

Update the main SELinux manpage to explain that runtime disable (i.e. disabling SELinux using SELINUX=Disabled) is deprecated and recommend disabling SELinux only via the kernel boot parameter.

---
 libselinux/man/man8/selinux.8 | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
libselinux/man/man8/selinux.8 +0 -0
index 31364271..721a65f4 100644

libselinux/man/man8/selinux.8 enabled or disabled, and if enabled, whether SELinux operates in · line 22

Quoted 6 lines
libselinux/man/man8/selinux.8 +1 -2
@@ -19,12 +19,12 @@ enabled or disabled, and if enabled, whether SELinux operates in
 permissive mode or enforcing mode.  The
 .B SELINUX
 variable may be set to
-any one of disabled, permissive, or enforcing to select one of these
-options.  The disabled option completely disables the SELinux kernel
+any one of Disabled, Permissive, or Enforcing to select one of these

Is there a reson for these changes? policycoreutils/man/man5/selinux_config.5 aka selinux_config(5) doesn't use capitals:

SELINUX = enforcing | permissive | disabled

Quoted 38 lines
libselinux/man/man8/selinux.8 +21 -2
+options.  The Disabled option completely disables the SELinux kernel
 and application code, leaving the system running without any SELinux
-protection.  The permissive option enables the SELinux code, but
+protection.  The Permissive option enables the SELinux code, but
 causes it to operate in a mode where accesses that would be denied by
-policy are permitted but audited.  The enforcing option enables the
+policy are permitted but audited.  The Enforcing option enables the
 SELinux code and causes it to enforce access denials as well as
 auditing them.  Permissive mode may yield a different set of denials
 than enforcing mode, both because enforcing mode will prevent an
@@ -32,6 +32,24 @@ operation from proceeding past the first denial and because some
 application code will fall back to a less privileged mode of operation
 if denied access.
 
+.B NOTE:
+Disabling SELinux by setting
+.B SELINUX=Disabled
+in
+.I /etc/selinux/config
+is deprecated and depending on kernel version and configuration it might
+not lead to SELinux being completely disabled.  Specifically, the
+SELinux hooks will still be executed internally, but the SELinux policy
+will not be loaded and no operation will be denied.  In such state, the
+system will act as if SELinux was disabled, although some operations
+might behave slightly differently.  To properly disable SELinux, it is
+recommended to use the
+.B selinux=0
+kernel boot option instead.  In that case SELinux will be disabled
+regardless of what is set in the
+.I /etc/selinux/config
+file.
+
 The
 .I /etc/selinux/config
 configuration file also controls what policy
Signature · 1 line
2.26.2
#2 lore raw
Quoted 10 lines · Petr Lautrbach
Quoted 9 lines · Ondrej Mosnacek

Update the main SELinux manpage to explain that runtime disable (i.e. disabling SELinux using SELINUX=Disabled) is deprecated and recommend disabling SELinux only via the kernel boot parameter.

---
 libselinux/man/man8/selinux.8 | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
Quoted 13 lines

libselinux/man/man8/selinux.8 enabled or disabled, and if enabled, whether SELinux operates in · line 22

Quoted 11 lines
libselinux/man/man8/selinux.8 +1 -2
index 31364271..721a65f4 100644
@@ -19,12 +19,12 @@ enabled or disabled, and if enabled, whether SELinux operates in
 permissive mode or enforcing mode.  The
 .B SELINUX
 variable may be set to
-any one of disabled, permissive, or enforcing to select one of these
-options.  The disabled option completely disables the SELinux kernel
+any one of Disabled, Permissive, or Enforcing to select one of these

Is there a reson for these changes?

Just for better readability. Although I should probably just mark them up, as in selinux_config(5)...

Quoted 4 lines

policycoreutils/man/man5/selinux_config.5 aka selinux_config(5) doesn't use capitals:

SELINUX = enforcing | permissive | disabled

Good point, it should be consistent. And also that page will need a similar update. v2 coming soon...

Quoted 39 lines
Quoted 39 lines
libselinux/man/man8/selinux.8 +21 -3
+options.  The Disabled option completely disables the SELinux kernel
 and application code, leaving the system running without any SELinux
-protection.  The permissive option enables the SELinux code, but
+protection.  The Permissive option enables the SELinux code, but
 causes it to operate in a mode where accesses that would be denied by
-policy are permitted but audited.  The enforcing option enables the
+policy are permitted but audited.  The Enforcing option enables the
 SELinux code and causes it to enforce access denials as well as
 auditing them.  Permissive mode may yield a different set of denials
 than enforcing mode, both because enforcing mode will prevent an
@@ -32,6 +32,24 @@ operation from proceeding past the first denial and because some
 application code will fall back to a less privileged mode of operation
 if denied access.
 
+.B NOTE:
+Disabling SELinux by setting
+.B SELINUX=Disabled
+in
+.I /etc/selinux/config
+is deprecated and depending on kernel version and configuration it might
+not lead to SELinux being completely disabled.  Specifically, the
+SELinux hooks will still be executed internally, but the SELinux policy
+will not be loaded and no operation will be denied.  In such state, the
+system will act as if SELinux was disabled, although some operations
+might behave slightly differently.  To properly disable SELinux, it is
+recommended to use the
+.B selinux=0
+kernel boot option instead.  In that case SELinux will be disabled
+regardless of what is set in the
+.I /etc/selinux/config
+file.
+
 The
 .I /etc/selinux/config
 configuration file also controls what policy
--

2.26.2

Signature · 3 lines
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel
Red Hat, Inc.
maintainer
#3 lore raw
Quoted 28 lines · Ondrej Mosnacek
Quoted 10 lines · Petr Lautrbach
Quoted 9 lines · Ondrej Mosnacek

Update the main SELinux manpage to explain that runtime disable (i.e. disabling SELinux using SELINUX=Disabled) is deprecated and recommend disabling SELinux only via the kernel boot parameter.

---
 libselinux/man/man8/selinux.8 | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)
Quoted 13 lines

libselinux/man/man8/selinux.8 enabled or disabled, and if enabled, whether SELinux operates in · line 22

Quoted 11 lines
libselinux/man/man8/selinux.8 +1 -2
index 31364271..721a65f4 100644
@@ -19,12 +19,12 @@ enabled or disabled, and if enabled, whether SELinux operates in
 permissive mode or enforcing mode.  The
 .B SELINUX
 variable may be set to
-any one of disabled, permissive, or enforcing to select one of these
-options.  The disabled option completely disables the SELinux kernel
+any one of Disabled, Permissive, or Enforcing to select one of these

Is there a reson for these changes?

Just for better readability. Although I should probably just mark them up, as in selinux_config(5)...

Quoted 7 lines
Quoted 4 lines

policycoreutils/man/man5/selinux_config.5 aka selinux_config(5) doesn't use capitals:

SELINUX = enforcing | permissive | disabled

Good point, it should be consistent. And also that page will need a similar update. v2 coming soon...

Thanks!

Signature · 2 lines
paul moore
www.paul-moore.com