linux/Documentation/ABI/obsolete
Paul Moore f22f9aaf6c selinux: remove the runtime disable functionality
After working with the larger SELinux-based distros for several
years, we're finally at a place where we can disable the SELinux
runtime disable functionality.  The existing kernel deprecation
notice explains the functionality and why we want to remove it:

  The selinuxfs "disable" node allows SELinux to be disabled at
  runtime prior to a policy being loaded into the kernel.  If
  disabled via this mechanism, SELinux will remain disabled until
  the system is rebooted.

  The preferred method of disabling SELinux is via the "selinux=0"
  boot parameter, but the selinuxfs "disable" node was created to
  make it easier for systems with primitive bootloaders that did not
  allow for easy modification of the kernel command line.
  Unfortunately, allowing for SELinux to be disabled at runtime makes
  it difficult to secure the kernel's LSM hooks using the
  "__ro_after_init" feature.

It is that last sentence, mentioning the '__ro_after_init' hardening,
which is the real motivation for this change, and if you look at the
diffstat you'll see that the impact of this patch reaches across all
the different LSMs, helping prevent tampering at the LSM hook level.

From a SELinux perspective, it is important to note that if you
continue to disable SELinux via "/etc/selinux/config" it may appear
that SELinux is disabled, but it is simply in an uninitialized state.
If you load a policy with `load_policy -i`, you will see SELinux
come alive just as if you had loaded the policy during early-boot.

It is also worth noting that the "/sys/fs/selinux/disable" file is
always writable now, regardless of the Kconfig settings, but writing
to the file has no effect on the system, other than to display an
error on the console if a non-zero/true value is written.

Finally, in the several years where we have been working on
deprecating this functionality, there has only been one instance of
someone mentioning any user visible breakage.  In this particular
case it was an individual's kernel test system, and the workaround
documented in the deprecation notice ("selinux=0" on the kernel
command line) resolved the issue without problem.

Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2023-03-20 12:34:23 -04:00
..
o2cb ABI: o2cb: add an obsolete file for /sys/o2cb 2021-09-28 12:48:15 +02:00
procfs-i8k Documentation: ABI: Add ABI file for legacy /proc/i8k interface 2022-02-27 17:03:16 -08:00
sysfs-bus-iio ABI: obsolete/sysfs-bus-iio: add some missing blank lines 2021-09-28 12:48:15 +02:00
sysfs-bus-usb USB: deprecate the power/level sysfs attribute 2010-05-20 13:21:37 -07:00
sysfs-class-typec usb: typec: Bus type for alternate modes 2018-07-02 17:42:36 +02:00
sysfs-cpuidle docs: typo fixes in Documentation/ABI/ 2021-05-13 09:13:25 -06:00
sysfs-driver-hid-roccat-arvo HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-isku HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-koneplus HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-konepure HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-kovaplus HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-lua HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-pyra docs: ABI: cleanup several ABI documents 2020-10-30 13:14:29 +01:00
sysfs-driver-hid-roccat-ryos HID: roccat: Fixed resubmit: Deprecating most Roccat sysfs attributes 2015-10-21 11:54:42 +02:00
sysfs-driver-hid-roccat-savu Documentation: fix common spelling mistakes 2016-04-28 07:51:59 -06:00
sysfs-driver-intel_pmc_bxt platform/x86: intel_pmc_ipc: Convert to MFD 2020-04-24 11:18:44 +01:00
sysfs-firmware-acpi ACPI / scan: Drop support for force_remove 2017-04-13 03:51:47 +02:00
sysfs-gpio docs: ABI: don't escape ReST-incompatible chars from obsolete and removed 2020-10-30 13:07:02 +01:00
sysfs-kernel-fadump_enabled Documentation/ABI: Mark /sys/kernel/fadump_* sysfs files deprecated 2020-02-19 22:45:36 +11:00
sysfs-kernel-fadump_registered docs: ABI: remove a meaningless UTF-8 character 2021-05-11 11:00:17 -06:00
sysfs-kernel-fadump_release_mem docs: ABI: remove a meaningless UTF-8 character 2021-05-11 11:00:17 -06:00