A security-module hook for user-namespace creation
A security-module hook for user-namespace creation
Posted Aug 4, 2022 22:13 UTC (Thu) by Paf (subscriber, #91811)In reply to: A security-module hook for user-namespace creation by Cyberax
Parent article: A security-module hook for user-namespace creation
(Log in to post comments)
A security-module hook for user-namespace creation
Posted Aug 5, 2022 1:36 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]
Ok. "Failed to be widely useful".
A security-module hook for user-namespace creation
Posted Aug 5, 2022 6:40 UTC (Fri) by jrjohansen (subscriber, #75010) [Link]
A security-module hook for user-namespace creation
Posted Aug 5, 2022 12:24 UTC (Fri) by ballombe (subscriber, #9523) [Link]
Could you provide one that is convincing ?
A security-module hook for user-namespace creation
Posted Aug 5, 2022 17:24 UTC (Fri) by jrjohansen (subscriber, #75010) [Link]
A security-module hook for user-namespace creation
Posted Aug 5, 2022 20:01 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]
This doesn't prevent the exploit that allows the attacker to run arbirtrary code, but it prevents this arbitrary code from gaining root right away. Assuming no other exploits.
> CVE-2017-6074
This is BS. Basically, "you can use SELinux to prohibit loading of modules". You can also just delete them, it's not a mitigation.
> CVE-2019-5736
This was the only real non-trivial one from your list, and in this case the proper fix is to use user namespaces.
All in all, very few exploits are truly prevented by SELinux. It sometimes makes it harder for attacker to gain wider access.
A security-module hook for user-namespace creation
Posted Aug 5, 2022 23:50 UTC (Fri) by Wol (subscriber, #4433) [Link]
> This is BS. Basically, "you can use SELinux to prohibit loading of modules". You can also just delete them, it's not a mitigation.
Not having read any of the background stuff but ... how does deleting modules protect against an attacker dropping a module onto your system?
Mind you, I believe you can also build your kernel with the "load module" code missing, no? Perfect for gentoo users like me :-)
Cheers,
Wol
A security-module hook for user-namespace creation
Posted Aug 9, 2022 3:13 UTC (Tue) by jrjohansen (subscriber, #75010) [Link]
>
>> This is BS. Basically, "you can use SELinux to prohibit loading of modules". You can also just delete them, it's not a mitigation.
>
> Not having read any of the background stuff but ... how does deleting modules protect against an attacker dropping a module onto your system?
>
If the attacker can load or get modules to load, the attacker may be able to exploit a flaw in a module to gain root or even just full kernel privileges. Now you might think if the attack can load a module or get a module to load they are already root, but that isn't always the case. They could be a regular user who can get a module to autoload via some action or they could have restricted root privileges (basically sandboxed in some way).
If the attacker can build and load their built module they can easily gain full kernel privileges, but on systems where they can only trigger module auto-load of existing modules or if the system require signed modules, the attacker will have to resort to exploiting flaws in existing modules.
> Mind you, I believe you can also build your kernel with the "load module" code missing, no? Perfect for gentoo users like me :-)
that is an option that does work for those who can use it.
A security-module hook for user-namespace creation
Posted Aug 8, 2022 20:03 UTC (Mon) by jrjohansen (subscriber, #75010) [Link]
>
> This doesn't prevent the exploit that allows the attacker to run arbirtrary code, but it prevents this arbitrary code from gaining root right away. Assuming no other exploits.
of course it can't stop or fix every flaw/CVE in an application, but it did do its job of containing said flaw and prevented it from becoming a root exploit. Yes there could be another way to elevate to root that is always a possibility unless you can mathematically prove otherwise, but it did stop this one.
> > CVE-2017-6074
>
> This is BS. Basically, "you can use SELinux to prohibit loading of modules". You can also just delete them, it's not a mitigation.
Yes it is. Sure there are other ways to block modules from loading: building the kernel without module support, lockdown (also an LSM), loadpin (also an LSM). What SELinux brings is context, where some services are still allowed to load modules, because the broader solutions don't work for some environments.
> > CVE-2019-5736
>
> This was the only real non-trivial one from your list, and in this case the proper fix is to use user namespaces.
The proper fix is always to patch/rewrite the software to remove the vulnerability, that doesn't take away from SELinux doing its job here.
> All in all, very few exploits are truly prevented by SELinux. It sometimes makes it harder for attacker to gain wider access.
Security is about layers and making it harder for an attacker is a win. No SELinux won't fix programs that have exploits in them, but neither do user namespaces.
A security-module hook for user-namespace creation
Posted Aug 6, 2022 12:15 UTC (Sat) by ballombe (subscriber, #9523) [Link]
https://security-tracker.debian.org/tracker/CVE-2014-7169
https://security-tracker.debian.org/tracker/CVE-2016-9962
https://security-tracker.debian.org/tracker/CVE-2017-6074
https://security-tracker.debian.org/tracker/CVE-2017-7494
https://security-tracker.debian.org/tracker/CVE-2019-5736
So all those CVE lead to packages update and all but one lead to a DSA to be issued,
the exception being a CVE that only affected unstable.
So as far as Debian is concerned, LSM do not seems to reduce the number of security updates.
A security-module hook for user-namespace creation
Posted Aug 6, 2022 13:11 UTC (Sat) by mathstuf (subscriber, #69389) [Link]
A security-module hook for user-namespace creation
Posted Aug 6, 2022 14:28 UTC (Sat) by rahulsundaram (subscriber, #21946) [Link]
This isn't the purpose of LSM. It is to mitigate or reduce the severity of vulnerability for end users. Distributions may choose to downgrade the severity of the issue based on the mitigations available by default however they won't be able to negate their responsibility to issue updates regardless. This isn't specific to LSM, if say, Firefox sandboxing stops a vulnerability from being exploited currently, Mozilla isn't going to just ignore the vulnerability, they will still patch it anyway.
A security-module hook for user-namespace creation
Posted Aug 8, 2022 19:43 UTC (Mon) by jrjohansen (subscriber, #75010) [Link]
LSMs can however stop, mitigate or contain an exploit reducing severity of a vulnerability, and hence reducing the priority of fixing a given CVE.