First, you can stop SELinux from working by misconfiguring it. That does nothing to disable any backdoor, though.
Then you can stop SELinux from doing anything by configuring it at runtime. If you run setenforce 0
, SELinux stops enforcing security restrictions. It's still active, though. All you've done is potentially make your system less secure by removing security restrictions.
If you don't want SELinux to apply at all, you can turn it off at boot time with the kernel parameter selinux=0
. This way SELinux won't be making any decisions. You lose any security benefit it may bring of course. And if there's a backdoor, you have no way to know that it isn't still active. The code is still present, after all.
Ok then, you need to remove the code from the kernel. So recompile your kernel, with the configuration option CONFIG_SECURITY_SELINUX
not set. Reboot, and now the SELinux code isn't running anymore. Victory?
Ha! No: how do you know that the backdoor is in the code that's controlled by this configuration option? If I was going to hide a backdoor, I'd make sure that it would be part of code that everybody uses.
If you want to be sure to be rid of whatever backdoor may have been introduced as part of SELinux, you need to go back to a kernel version that dates from before SELinux was introduced, and carefully evaluate all the commits that were made to the kernel since then and decide whether they are backdoor-free. Once you've done that, you'll have a backdoor-free system. I mean, a backdoor-free kernel. I mean, a kernel without this particular backdoor that you posit.
Psych! No, the backdoor may still be there. What if there was a backdoor in the kernel that affected the compiler, so that when you compiled the kernel, it injected the backdoor into the kernel even if the source of the backdoor wasn't present? This would be a self-sustaining backdoor: compile with a backdoored compiler or under a backdoored kernel, and the resulting kernel is still backdoored. Sounds far-fetched? You think no one could do that? Sorry, but it has been done. Do read Ken Thompson's Turing Award lecture, “Reflections on Trusting Trust”.
Ok, ok. You can't trust the software. So you'll need to write your own software, and your own compiler, and be sure not to use the current, possibly suspect compiler or kernel to compile your own backdoor-free system. Write machine code directly, I guess.
Ah, but beware! A malicious operating system (or malicious software with kernel-level access, for that matter) could have injected a backdoor into your firmware. So if you don't trust your current kernel, you can't trust your BIOS, either.
No, no, this won't go. You'll need to make your own hardware. Good luck!