Linux Kernel Unshare Function Bug in Namespace Handling

Vulnerability

A vulnerability in the Linux kernel's unshare function can lead to incorrect handling of filesystem namespaces. This issue arises when the CLONE_NEWNS flag is used, but the current filesystem has not been shared. In such cases, the function passes the current filesystem reference to the copy_mnt_ns function instead of a private copy. This can create a situation where, after successfully copying the mount namespace, the function fails when trying to copy the cgroup namespace, leaving the process with references to detached mounts. This bug has existed since the introduction of the unshare function.

Impact

The vulnerability can cause the unshare function to fail with an out-of-memory error while leaving the process with invalid references to detached mounts, disrupting normal operations.

Reproduction

To reproduce this issue, use the unshare system call with the CLONE_NEWNS flag on a process whose filesystem has not been shared. This will trigger the vulnerability by passing a reference to the unshared filesystem instead of a private copy, leading to the described incorrect namespace handling.

Remediation

The vulnerability has been fixed in the Linux kernel. Users should upgrade to the latest version.

Added: May 8, 2026, 6:54 PM
Updated: May 8, 2026, 6:54 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
0.6
exploitability
3.9
remediation
7.7
relevance
7.8
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.