4 ms·
>So they took advantage of the fact that many Android devices shipped a kernel with a flawed copy_from_user() implementation that allowed them to copy arbitrary
by mrweasel 11y ago
>So they took advantage of the fact that many Android devices shipped a kernel with a flawed copy_from_user() implementation that allowed them to copy arbitrary userspace data over arbitrary kernel code, thus allowing them to disable SELinux.
Why is it even possible to disable SELinux at runtime?
That should be a compile time option. Either you want the added security, or you don't. It's useless if someone can turn it off.
It required a flawed copy_from_user() implementation, which is now fixed. That's just not the only bug in the Linux kernel, there will be new ones. New ones that may or may not allow a attacker to disable SELinux. The problem is that it is modifiable.
Earlier today there was the story about OpenBSDs pledge(). One of the basic ideas of pledge is that you can't turn it off.
- forgottenpass 11y agoWhy is it even possible to disable SELinux at runtime? Because policy configuration happens from userspace. And it doesn't really matter if root users are disabling it, or just doing the equivalent of `chmod -R 777 *` without technically "disabling" it.
- jjuhl 11y agoNo. Because bugs. If you can write to arbitrary kernel memory you can do anything you like. Disable selinux; write funny messages to the console - it's all yours for the taking.
- tremon 11y ago> Why is it even possible to disable SELinux at runtime? As with all things SELinux, it's a policy setting. You can configure your policy to disallow disabling SELinux. That wouldn't have made a difference in this case though, when you have unprivileged applications accessing kernel memory directly.
- mjg59 11y ago> Why is it even possible to disable SELinux at runtime? If you're able to overwrite arbitrary kernel memory you can just replace the SELinux code with code that says you can do anything. The idea is to make it more difficult to take advantage of kernel bugs such that you can modify arbitrary kernel state.