This is a note to let you know that I've just added the patch titled vfs: Add a mount flag to lock read only bind mounts to the 3.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: vfs-add-a-mount-flag-to-lock-read-only-bind-mounts.patch and it can be found in the queue-3.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 90563b198e4c6674c63672fae1923da467215f45 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Date: Fri, 22 Mar 2013 03:10:15 -0700 Subject: vfs: Add a mount flag to lock read only bind mounts From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> commit 90563b198e4c6674c63672fae1923da467215f45 upstream. When a read-only bind mount is copied from mount namespace in a higher privileged user namespace to a mount namespace in a lesser privileged user namespace, it should not be possible to remove the the read-only restriction. Add a MNT_LOCK_READONLY mount flag to indicate that a mount must remain read-only. Acked-by: Serge Hallyn <serge.hallyn@xxxxxxxxxxxxx> Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/namespace.c | 3 +++ include/linux/mount.h | 2 ++ 2 files changed, 5 insertions(+) --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1736,6 +1736,9 @@ static int change_mount_flags(struct vfs if (readonly_request == __mnt_is_readonly(mnt)) return 0; + if (mnt->mnt_flags & MNT_LOCK_READONLY) + return -EPERM; + if (readonly_request) error = mnt_make_readonly(real_mount(mnt)); else --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -47,6 +47,8 @@ struct mnt_namespace; #define MNT_INTERNAL 0x4000 +#define MNT_LOCK_READONLY 0x400000 + struct vfsmount { struct dentry *mnt_root; /* root of the mounted tree */ struct super_block *mnt_sb; /* pointer to superblock */ Patches currently in stable-queue which might be from ebiederm@xxxxxxxxxxxx are queue-3.8/vfs-carefully-propogate-mounts-across-user-namespaces.patch queue-3.8/vfs-add-a-mount-flag-to-lock-read-only-bind-mounts.patch queue-3.8/userns-don-t-allow-creation-if-the-user-is-chrooted.patch queue-3.8/pid-handle-the-exit-of-a-multi-threaded-init.patch queue-3.8/ipc-restrict-mounting-the-mqueue-filesystem.patch queue-3.8/scm-require-cap_sys_admin-over-the-current-pidns-to-spoof-pids.patch queue-3.8/userns-restrict-when-proc-and-sysfs-can-be-mounted.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html