• E
    mnt: Only change user settable mount flags in remount · a6138db8
    Eric W. Biederman 提交于
    Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
    read-only bind mount read-only in a user namespace the
    MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
    to the remount a read-only mount read-write.
    
    Correct this by replacing the mask of mount flags to preserve
    with a mask of mount flags that may be changed, and preserve
    all others.   This ensures that any future bugs with this mask and
    remount will fail in an easy to detect way where new mount flags
    simply won't change.
    
    Cc: stable@vger.kernel.org
    Acked-by: NSerge E. Hallyn <serge.hallyn@ubuntu.com>
    Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
    a6138db8
namespace.c 72.6 KB