1

from https://www.stigviewer.com/stig/red_hat_enterprise_linux_8/2021-12-03/finding/V-230548

RHEL 8 must disable the use of user namespaces.

It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities or services are often overlooked and therefore may remain unsecured. They increase the risk to the platform by providing additional attack vectors. The sysctl --system command will load settings from all system configuration files. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. Files are read from directories in the following list from top to bottom. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. /etc/sysctl.d/.conf /run/sysctl.d/.conf /usr/local/lib/sysctl.d/.conf /usr/lib/sysctl.d/.conf /lib/sysctl.d/*.conf /etc/sysctl.conf Based on the information above, if a configuration file that begins with "99-" is created in the "/etc/sysctl.d/" directory, it will take precedence over any other configuration file on the system.

Note: User namespaces are used primarily for Linux containers. If containers are in use, this requirement is not applicable.

However from https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html#linux-user-namespaces

From Linux 5.10, all users are allowed to create user namespaces by default. This will allow programs such as web browsers and container managers to create more restricted sandboxes for untrusted or less-trusted code, without the need to run as root or to use a setuid-root helper.

The previous Debian default was to restrict this feature to processes running as root, because it exposed more security issues in the kernel. However, as the implementation of this feature has matured, we are now confident that the risk of enabling it is outweighed by the security benefits it provides.

and https://man7.org/linux/man-pages/man7/user_namespaces.7.html

In RHEL-8.10 my /opt/anaconda3/bin/spyder coredumps when launched with the error of

FATAL:credentials.cc(137)] Check failed: error == EPERM || error == EUSERS || error == EINVAL || error == ENOSYS. :

No space left on device

In my own testing I have discovered setting user.max_user_namespaces = 5 or higher in /etc/sysctl.conf fixed the problem of spyder core dumping when launched, and setting this to 0 was the sole cause of the problem.

  • Regarding the functionality of what little thus far I have read into about user.max_user_namespaces, is allowing it to have some number (other than setting it to 0) actually better for security?

  • Is the stigviewer statement regarding primarly for Linux containers accurate?

  • Can anyone list other software that makes use of user namespaces where setting this to zero would cause a similiar issue?

  • Is writing software programs in Linux to make use of user namespaces bad or good in the context of security?

1 Answer 1

1

Regarding the functionality of what little thus far I have read into about user.max_user_namespaces, is allowing it to have some number (other than setting it to 0) actually better for security?

That’s impossible to answer without knowing the specific threat models you’re considering.

Is the stigviewer statement regarding primarly for Linux containers accurate?

In the grand scheme of things, there are probably more Linux systems running containers than running other pieces of software capable of using user namespaces, so pedantically, yes. However given that modern web browsers use user namespaces, at least for desktop users of Linux I suspect that the statement is inaccurate.

Can anyone list other software that makes use of user namespaces where setting this to zero would cause a similiar issue?

Web browsers (and software using web browser components), for one. Web browser sandboxing won’t work as expected; in most cases that won’t stop the browser from working entirely. In your particular case, the crash is caused by a web browser component. (That link has a suggested workaround, --no-web-widgets.)

Is writing software programs in Linux to make use of user namespaces bad or good in the context of security?

Notwithstanding my “get out of explaining things free” card used above, user namespaces are an additional tool in the software development arsenal, and having more tools to use is arguably good in the context of security, if they’re used judiciously. Being able to build sandboxes with meaningful restrictions in permissions is better in most cases as far as I’m concerned.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.