---
name: "security_disable"
section: "3"
platform: "linux"
package: "libselinux1-dev"
version: "3.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/security_disable"
---

# security\_disable(3)

disable the SELinux kernel code at runtime

## NAME

security\_disable - disable the SELinux kernel code at runtime

## SYNOPSIS

**#include \<selinux/selinux.h\>**

**int security\_disable(void);**

## DESCRIPTION

**security\_disable**() disables the SELinux kernel code, unregisters selinuxfs from */proc/filesystems*, and then unmounts */sys/fs/selinux*.

This function is only supported on Linux 6.3 and earlier, and can only be called at runtime and prior to the initial policy load. After the initial policy load, the SELinux kernel code cannot be disabled, but only placed in "permissive" mode by using **[security\_setenforce(3)](/security_setenforce/3.md).**

## RETURN VALUE

**security\_disable**() returns zero on success or -1 on error.

## AUTHOR

This manual page has been written by Guido Trentalancia \<guido@trentalancia.com\>

## SEE ALSO

[**selinux**(8)](/selinux/8.md), **setenforce** (8)
