security_disable(3)

πŸ“¦
version 3.11 Β· 2 versions
, in alpine 3.24, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

security_disable β€” bestie, this one turns off the SELinux kernel code at runtime πŸ‘‘

πŸŽ€ SYNOPSIS πŸŽ€

#include <selinux/selinux.h>

int security_disable(void);

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea πŸ“ β€” security_disable() does three things in one glorious swoop:

  • it disables the SELinux kernel code
  • it unregisters selinuxfs from /proc/filesystems
  • and then it unmounts /sys/fs/selinux

like, it's giving full shutdown energy fr fr πŸ’…

⚠️ now listen, this is the important part. This function is only supported on Linux 6.3 and earlier, and it can only be called at runtime and prior to the initial policy load. Periodt.

After the initial policy load? Nope. The SELinux kernel code cannot be disabled at that point β€” it can only be placed in "permissive" mode by using security_setenforce(3). That's the only move left, bestie 😭

🌸 RETURN VALUE 🌸

security_disable() returns zero on success or -1 on error. Simple as that 🫢

πŸ¦‹ AUTHOR πŸ¦‹

This manual page has been written by Guido Trentalancia <guido@trentalancia.com> β€” ty for your service king πŸ‘‘

⭐ SEE ALSO ⭐


and that's the whole vibe check, bestie πŸ’œ this lil page is part of the SELinux API documentation, and it's dated 21 Nov 2009 β€” yes she's an icon, yes she's been iconic for a minute, no cap. mwah, go be safe out there 🌈✨