Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META] Hardened kernel issues and workarounds #1

Open
ShellCode33 opened this issue Aug 16, 2023 · 0 comments
Open

[META] Hardened kernel issues and workarounds #1

ShellCode33 opened this issue Aug 16, 2023 · 0 comments

Comments

@ShellCode33
Copy link
Owner

ShellCode33 commented Aug 16, 2023

This issue aims to list all the issues you might encounter because of the linux-hardened kernel, and potential workarounds, if any. I will try to keep it as up to date as possible, you can of course contribute.

For what it's worth I have to say it has been pretty stable for me over the past few months. I was expecting it to break things more often.

Unprivileged user namespaces

This is probably one of the most controversial feature of the Linux kernel.
It allows unprivileged users to create namespaces which allows them to perform root operations in a confined environment (by remapping user IDs). The thing is that this feature goes through code paths in the kernel that is usually only reachable by root, and that is not as much tested as regular "user code paths". Many security vulnerabilities have been discovered and exploited in the wild because of this feature. However it's been a while now since that feature was introduced, and it is now enabled by default on most mainstream distributions. Even in the regular ArchLinux kernel.

Containers engines (docker, podman, LXC, etc.) heavily depend on this feature, and because it is disabled in linux-hardened, rootless containers cannot work. You have to run containers as root.

So now it's your choice to make, are you fine sticking to root containers or do you wish to use rootless ones ? I made my mind, and decided to stick to root containers. But it could change.

If rootless containers are a must have for you, you can enable them using:

sudo sysctl -w kernel.unprivileged_userns_clone=1

If you want this change to be persistent, create a file in /etc/sysctl.d/.

References:

@ShellCode33 ShellCode33 pinned this issue Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant