aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-07-26 21:42:03 -0700
committerZiyan <jaraidaniel@gmail.com>2016-04-03 14:55:55 +0200
commit7a2ee4344922996036d5c0005ace454e4c8cf59a (patch)
treefc5f14e4ed90c0ac0b6298168bc65bc0dbc3be37 /include
parentdc5c351d1b7429e8f2188cc980ef0137f90838e2 (diff)
downloadkernel_samsung_tuna-7a2ee4344922996036d5c0005ace454e4c8cf59a.zip
kernel_samsung_tuna-7a2ee4344922996036d5c0005ace454e4c8cf59a.tar.gz
kernel_samsung_tuna-7a2ee4344922996036d5c0005ace454e4c8cf59a.tar.bz2
vfs: Allow unprivileged manipulation of the mount namespace.
- Add a filesystem flag to mark filesystems that are safe to mount as an unprivileged user. - Add a filesystem flag to mark filesystems that don't need MNT_NODEV when mounted by an unprivileged user. - Relax the permission checks to allow unprivileged users that have CAP_SYS_ADMIN permissions in the user namespace referred to by the current mount namespace to be allowed to mount, unmount, and move filesystems. Acked-by: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> (cherry picked from commit 0c55cfc4166d9a0f38de779bd4d75a90afbe7734)
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/mount.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index aecbf99..6abb69a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1810,6 +1810,13 @@ int sync_inode_metadata(struct inode *inode, int wait);
struct file_system_type {
const char *name;
int fs_flags;
+#define FS_REQUIRES_DEV 1
+#define FS_BINARY_MOUNTDATA 2
+#define FS_HAS_SUBTYPE 4
+#define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */
+#define FS_USERNS_DEV_MOUNT 16 /* A userns mount does not imply MNT_NODEV */
+#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
+#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */
struct dentry *(*mount) (struct file_system_type *, int,
const char *, void *);
void (*kill_sb) (struct super_block *);
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 0c5e36b..fe90f57 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -100,9 +100,6 @@ extern void mnt_pin(struct vfsmount *mnt);
extern void mnt_unpin(struct vfsmount *mnt);
extern int __mnt_is_readonly(struct vfsmount *mnt);
-extern struct vfsmount *do_kern_mount(const char *fstype, int flags,
- const char *name, void *data);
-
struct file_system_type;
extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
int flags, const char *name,