Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull misc vfs fixes from Al Viro:
"Several assorted fixes.

I still think that audit ->d_name race is better fixed this way for
the benefit of backports, with any possibly fancier variants done on
top of it"

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
dump_common_audit_data(): fix racy accesses to ->d_name
iov_iter: fix the uaccess area in copy_compat_iovec_from_user
umount(2): move the flag validity checks first

Changed files
+11 -5
fs
lib
security
+5 -2
fs/namespace.c
··· 1713 1713 { 1714 1714 struct mount *mnt = real_mount(path->mnt); 1715 1715 1716 - if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) 1717 - return -EINVAL; 1718 1716 if (!may_mount()) 1719 1717 return -EPERM; 1720 1718 if (path->dentry != path->mnt->mnt_root) ··· 1726 1728 return 0; 1727 1729 } 1728 1730 1731 + // caller is responsible for flags being sane 1729 1732 int path_umount(struct path *path, int flags) 1730 1733 { 1731 1734 struct mount *mnt = real_mount(path->mnt); ··· 1747 1748 int lookup_flags = LOOKUP_MOUNTPOINT; 1748 1749 struct path path; 1749 1750 int ret; 1751 + 1752 + // basic validity checks done first 1753 + if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW)) 1754 + return -EINVAL; 1750 1755 1751 1756 if (!(flags & UMOUNT_NOFOLLOW)) 1752 1757 lookup_flags |= LOOKUP_FOLLOW;
+1 -1
lib/iov_iter.c
··· 1658 1658 (const struct compat_iovec __user *)uvec; 1659 1659 int ret = -EFAULT, i; 1660 1660 1661 - if (!user_access_begin(uvec, nr_segs * sizeof(*uvec))) 1661 + if (!user_access_begin(uiov, nr_segs * sizeof(*uiov))) 1662 1662 return -EFAULT; 1663 1663 1664 1664 for (i = 0; i < nr_segs; i++) {
+5 -2
security/lsm_audit.c
··· 275 275 struct inode *inode; 276 276 277 277 audit_log_format(ab, " name="); 278 + spin_lock(&a->u.dentry->d_lock); 278 279 audit_log_untrustedstring(ab, a->u.dentry->d_name.name); 280 + spin_unlock(&a->u.dentry->d_lock); 279 281 280 282 inode = d_backing_inode(a->u.dentry); 281 283 if (inode) { ··· 295 293 dentry = d_find_alias(inode); 296 294 if (dentry) { 297 295 audit_log_format(ab, " name="); 298 - audit_log_untrustedstring(ab, 299 - dentry->d_name.name); 296 + spin_lock(&dentry->d_lock); 297 + audit_log_untrustedstring(ab, dentry->d_name.name); 298 + spin_unlock(&dentry->d_lock); 300 299 dput(dentry); 301 300 } 302 301 audit_log_format(ab, " dev=");