clone_private_mnt(): make sure that caller has CAP_SYS_ADMIN in the right userns
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 427215d85e8d1476da1a86b8d67aceb485eb3631 · < c28f922c9dcee0e4876a2c095939d77fe7e15116| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
clone_private_mnt(): make sure that caller has CAP_SYS_ADMIN in the right userns
What we want is to verify there is that clone won't expose something hidden by a mount we wouldn't be able to undo. "Wouldn't be able to undo" may be a result of MNT_LOCKED on a child, but it may also come from lacking admin rights in the userns of the namespace mount belongs to.
clone_private_mnt() checks the former, but not the latter.
There's a number of rather confusing CAP_SYS_ADMIN checks in various userns during the mount, especially with the new mount API; they serve different purposes and in case of clone_private_mnt() they usually, but not always end up covering the missing check mentioned above.
From the CVE record · Linux
The Linux kernel's clone_private_mnt() does not always check whether the caller has CAP_SYS_ADMIN in the user namespace that owns the mount namespace. A caller lacking that permission may be able to clone a mount and expose content hidden by another mount. The input does not specify other access or user-interaction requirements.
Engineers running Linux kernels should check their versions against the vendor advisory; affected versions are not specified in the input.