mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
vfs: Carefully propogate mounts across user namespaces
As a matter of policy MNT_READONLY should not be changable if the original mounter had more privileges than creator of the mount namespace. Add the flag CL_UNPRIVILEGED to note when we are copying a mount from a mount namespace that requires more privileges to a mount namespace that requires fewer privileges. When the CL_UNPRIVILEGED flag is set cause clone_mnt to set MNT_NO_REMOUNT if any of the mnt flags that should never be changed are set. This protects both mount propagation and the initial creation of a less privileged mount namespace. Cc: stable@vger.kernel.org Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Reported-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
parent
90563b198e
commit
132c94e31b
3 changed files with 12 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
|||
#define CL_MAKE_SHARED 0x08
|
||||
#define CL_PRIVATE 0x10
|
||||
#define CL_SHARED_TO_SLAVE 0x20
|
||||
#define CL_UNPRIVILEGED 0x40
|
||||
|
||||
static inline void set_mnt_shared(struct mount *mnt)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue