The patch titled unprivileged mounts: fix subtype handling has been added to the -mm tree. Its filename is unprivileged-mounts-allow-unprivileged-mounts-fix-subtype-handling.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: unprivileged mounts: fix subtype handling From: Miklos Szeredi <mszeredi@xxxxxxx> Subtype handling was done in do_kern_mount(), but "unprivileged mounts: allow unprivileged mounts" patch made do_new_mount() use vfs_kern_mount(). This broke the filesystem subtype handling. Fix this by moving the subtype handling from do_kern_mount() into do_new_mount(). All other callers are kernel-internal and do not need subtype support. Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/namespace.c | 26 ++++++++++++++++++++++++++ fs/super.c | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff -puN fs/namespace.c~unprivileged-mounts-allow-unprivileged-mounts-fix-subtype-handling fs/namespace.c --- a/fs/namespace.c~unprivileged-mounts-allow-unprivileged-mounts-fix-subtype-handling +++ a/fs/namespace.c @@ -1186,6 +1186,29 @@ out: return err; } +static struct vfsmount *fs_set_subtype(struct vfsmount *mnt, const char *fstype) +{ + int err; + const char *subtype = strchr(fstype, '.'); + if (subtype) { + subtype++; + err = -EINVAL; + if (!subtype[0]) + goto err; + } else + subtype = ""; + + mnt->mnt_sb->s_subtype = kstrdup(subtype, GFP_KERNEL); + err = -ENOMEM; + if (!mnt->mnt_sb->s_subtype) + goto err; + return mnt; + + err: + mntput(mnt); + return ERR_PTR(err); +} + /* * create a new mount for userspace and request it to be added into the * namespace's tree @@ -1215,6 +1238,9 @@ static int do_new_mount(struct nameidata } mnt = vfs_kern_mount(type, flags & ~MS_SETUSER, name, data); + if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) && + !mnt->mnt_sb->s_subtype) + mnt = fs_set_subtype(mnt, fstype); put_filesystem(type); if (IS_ERR(mnt)) { if (flags & MS_SETUSER) diff -puN fs/super.c~unprivileged-mounts-allow-unprivileged-mounts-fix-subtype-handling fs/super.c --- a/fs/super.c~unprivileged-mounts-allow-unprivileged-mounts-fix-subtype-handling +++ a/fs/super.c @@ -906,29 +906,6 @@ out: EXPORT_SYMBOL_GPL(vfs_kern_mount); -static struct vfsmount *fs_set_subtype(struct vfsmount *mnt, const char *fstype) -{ - int err; - const char *subtype = strchr(fstype, '.'); - if (subtype) { - subtype++; - err = -EINVAL; - if (!subtype[0]) - goto err; - } else - subtype = ""; - - mnt->mnt_sb->s_subtype = kstrdup(subtype, GFP_KERNEL); - err = -ENOMEM; - if (!mnt->mnt_sb->s_subtype) - goto err; - return mnt; - - err: - mntput(mnt); - return ERR_PTR(err); -} - struct vfsmount * do_kern_mount(const char *fstype, int flags, const char *name, void *data) { @@ -937,9 +914,6 @@ do_kern_mount(const char *fstype, int fl if (!type) return ERR_PTR(-ENODEV); mnt = vfs_kern_mount(type, flags, name, data); - if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) && - !mnt->mnt_sb->s_subtype) - mnt = fs_set_subtype(mnt, fstype); put_filesystem(type); return mnt; } _ Patches currently in -mm which might be from mszeredi@xxxxxxx are fuse-convert-to-new-aops.patch ext2-show-all-mount-options.patch ext3-show-all-mount-options.patch ext4-show-all-mount-options.patch unprivileged-mounts-add-user-mounts-to-the-kernel.patch unprivileged-mounts-allow-unprivileged-umount.patch unprivileged-mounts-account-user-mounts.patch unprivileged-mounts-propagate-error-values-from-clone_mnt.patch unprivileged-mounts-allow-unprivileged-bind-mounts.patch unprivileged-mounts-put-declaration-of-put_filesystem-in-fsh.patch unprivileged-mounts-allow-unprivileged-mounts.patch unprivileged-mounts-allow-unprivileged-mounts-fix-subtype-handling.patch unprivileged-mounts-allow-unprivileged-fuse-mounts.patch unprivileged-mounts-propagation-inherit-owner-from-parent.patch unprivileged-mounts-propagation-inherit-owner-from-parent-fix-for-git-audit.patch unprivileged-mounts-add-no-submounts-flag.patch fuse-update-backing_dev_info-congestion-state.patch fuse-fix-reserved-request-wake-up.patch fuse-add-reference-counting-to-fuse_file.patch fuse-truncate-on-spontaneous-size-change.patch fuse-fix-page-invalidation.patch fuse-set-i_nlink-to-sane-value-after-mount.patch fuse-refresh-stale-attributes-in-fuse_permission.patch fuse-fix-permission-checking-on-sticky-directories.patch fuse-fix-permission-checking-on-sticky-directories-fix.patch fuse-cleanup-in-release.patch fuse-no-abort-on-interrupt.patch fuse-no-enoent-from-fuse-device-read.patch vfs-check-nanoseconds-in-utimensat.patch fix-execute-checking-in-permission.patch exec-remove-unnecessary-check-for-mnt_noexec.patch fuse-fix-setting-i_mode-bits.patch fuse-clean-up-execute-permission-checking.patch clean-out-unused-code-in-dentry-pruning.patch uml-remove-unnecessary-hostfs_getattr.patch fix-warnings-in-revoked_inodec.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html