Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
[PATCH] get rid of __exit_files(), __exit_fs() and __put_fs_struct()
[PATCH] proc_readfd_common() race fix
[PATCH] double-free of inode on alloc_file() failure exit in create_write_pipe()
[PATCH] teach seq_file to discard entries
[PATCH] umount_tree() will unhash everything itself
[PATCH] get rid of more nameidata passing in namespace.c
[PATCH] switch a bunch of LSM hooks from nameidata to path
[PATCH] lock exclusively in collect_mounts() and drop_collected_mounts()
[PATCH] move a bunch of declarations to fs/internal.h

+118 -120
+11
fs/internal.h
··· 43 43 * namespace.c 44 44 */ 45 45 extern int copy_mount_options(const void __user *, unsigned long *); 46 + 47 + extern void free_vfsmnt(struct vfsmount *); 48 + extern struct vfsmount *alloc_vfsmnt(const char *); 49 + extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); 50 + extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 51 + struct vfsmount *); 52 + extern void release_mounts(struct list_head *); 53 + extern void umount_tree(struct vfsmount *, int, struct list_head *); 54 + extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); 55 + 56 + extern void __init mnt_init(void);
+32 -34
fs/namespace.c
··· 1091 1091 struct vfsmount *collect_mounts(struct vfsmount *mnt, struct dentry *dentry) 1092 1092 { 1093 1093 struct vfsmount *tree; 1094 - down_read(&namespace_sem); 1094 + down_write(&namespace_sem); 1095 1095 tree = copy_tree(mnt, dentry, CL_COPY_ALL | CL_PRIVATE); 1096 - up_read(&namespace_sem); 1096 + up_write(&namespace_sem); 1097 1097 return tree; 1098 1098 } 1099 1099 1100 1100 void drop_collected_mounts(struct vfsmount *mnt) 1101 1101 { 1102 1102 LIST_HEAD(umount_list); 1103 - down_read(&namespace_sem); 1103 + down_write(&namespace_sem); 1104 1104 spin_lock(&vfsmount_lock); 1105 1105 umount_tree(mnt, 0, &umount_list); 1106 1106 spin_unlock(&vfsmount_lock); 1107 - up_read(&namespace_sem); 1107 + up_write(&namespace_sem); 1108 1108 release_mounts(&umount_list); 1109 1109 } 1110 1110 ··· 1205 1205 return 0; 1206 1206 } 1207 1207 1208 - static int graft_tree(struct vfsmount *mnt, struct nameidata *nd) 1208 + static int graft_tree(struct vfsmount *mnt, struct path *path) 1209 1209 { 1210 1210 int err; 1211 1211 if (mnt->mnt_sb->s_flags & MS_NOUSER) 1212 1212 return -EINVAL; 1213 1213 1214 - if (S_ISDIR(nd->path.dentry->d_inode->i_mode) != 1214 + if (S_ISDIR(path->dentry->d_inode->i_mode) != 1215 1215 S_ISDIR(mnt->mnt_root->d_inode->i_mode)) 1216 1216 return -ENOTDIR; 1217 1217 1218 1218 err = -ENOENT; 1219 - mutex_lock(&nd->path.dentry->d_inode->i_mutex); 1220 - if (IS_DEADDIR(nd->path.dentry->d_inode)) 1219 + mutex_lock(&path->dentry->d_inode->i_mutex); 1220 + if (IS_DEADDIR(path->dentry->d_inode)) 1221 1221 goto out_unlock; 1222 1222 1223 - err = security_sb_check_sb(mnt, nd); 1223 + err = security_sb_check_sb(mnt, path); 1224 1224 if (err) 1225 1225 goto out_unlock; 1226 1226 1227 1227 err = -ENOENT; 1228 - if (IS_ROOT(nd->path.dentry) || !d_unhashed(nd->path.dentry)) 1229 - err = attach_recursive_mnt(mnt, &nd->path, NULL); 1228 + if (IS_ROOT(path->dentry) || !d_unhashed(path->dentry)) 1229 + err = attach_recursive_mnt(mnt, path, NULL); 1230 1230 out_unlock: 1231 - mutex_unlock(&nd->path.dentry->d_inode->i_mutex); 1231 + mutex_unlock(&path->dentry->d_inode->i_mutex); 1232 1232 if (!err) 1233 - security_sb_post_addmount(mnt, nd); 1233 + security_sb_post_addmount(mnt, path); 1234 1234 return err; 1235 1235 } 1236 1236 ··· 1294 1294 if (!mnt) 1295 1295 goto out; 1296 1296 1297 - err = graft_tree(mnt, nd); 1297 + err = graft_tree(mnt, &nd->path); 1298 1298 if (err) { 1299 1299 LIST_HEAD(umount_list); 1300 1300 spin_lock(&vfsmount_lock); ··· 1501 1501 goto unlock; 1502 1502 1503 1503 newmnt->mnt_flags = mnt_flags; 1504 - if ((err = graft_tree(newmnt, nd))) 1504 + if ((err = graft_tree(newmnt, &nd->path))) 1505 1505 goto unlock; 1506 1506 1507 1507 if (fslist) /* add to the specified expiration list */ ··· 1746 1746 if (retval) 1747 1747 return retval; 1748 1748 1749 - retval = security_sb_mount(dev_name, &nd, type_page, flags, data_page); 1749 + retval = security_sb_mount(dev_name, &nd.path, 1750 + type_page, flags, data_page); 1750 1751 if (retval) 1751 1752 goto dput_out; 1752 1753 ··· 1987 1986 const char __user * put_old) 1988 1987 { 1989 1988 struct vfsmount *tmp; 1990 - struct nameidata new_nd, old_nd, user_nd; 1991 - struct path parent_path, root_parent; 1989 + struct nameidata new_nd, old_nd; 1990 + struct path parent_path, root_parent, root; 1992 1991 int error; 1993 1992 1994 1993 if (!capable(CAP_SYS_ADMIN)) 1995 1994 return -EPERM; 1996 - 1997 - lock_kernel(); 1998 1995 1999 1996 error = __user_walk(new_root, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, 2000 1997 &new_nd); ··· 2006 2007 if (error) 2007 2008 goto out1; 2008 2009 2009 - error = security_sb_pivotroot(&old_nd, &new_nd); 2010 + error = security_sb_pivotroot(&old_nd.path, &new_nd.path); 2010 2011 if (error) { 2011 2012 path_put(&old_nd.path); 2012 2013 goto out1; 2013 2014 } 2014 2015 2015 2016 read_lock(&current->fs->lock); 2016 - user_nd.path = current->fs->root; 2017 + root = current->fs->root; 2017 2018 path_get(&current->fs->root); 2018 2019 read_unlock(&current->fs->lock); 2019 2020 down_write(&namespace_sem); ··· 2021 2022 error = -EINVAL; 2022 2023 if (IS_MNT_SHARED(old_nd.path.mnt) || 2023 2024 IS_MNT_SHARED(new_nd.path.mnt->mnt_parent) || 2024 - IS_MNT_SHARED(user_nd.path.mnt->mnt_parent)) 2025 + IS_MNT_SHARED(root.mnt->mnt_parent)) 2025 2026 goto out2; 2026 - if (!check_mnt(user_nd.path.mnt)) 2027 + if (!check_mnt(root.mnt)) 2027 2028 goto out2; 2028 2029 error = -ENOENT; 2029 2030 if (IS_DEADDIR(new_nd.path.dentry->d_inode)) ··· 2033 2034 if (d_unhashed(old_nd.path.dentry) && !IS_ROOT(old_nd.path.dentry)) 2034 2035 goto out2; 2035 2036 error = -EBUSY; 2036 - if (new_nd.path.mnt == user_nd.path.mnt || 2037 - old_nd.path.mnt == user_nd.path.mnt) 2037 + if (new_nd.path.mnt == root.mnt || 2038 + old_nd.path.mnt == root.mnt) 2038 2039 goto out2; /* loop, on the same file system */ 2039 2040 error = -EINVAL; 2040 - if (user_nd.path.mnt->mnt_root != user_nd.path.dentry) 2041 + if (root.mnt->mnt_root != root.dentry) 2041 2042 goto out2; /* not a mountpoint */ 2042 - if (user_nd.path.mnt->mnt_parent == user_nd.path.mnt) 2043 + if (root.mnt->mnt_parent == root.mnt) 2043 2044 goto out2; /* not attached */ 2044 2045 if (new_nd.path.mnt->mnt_root != new_nd.path.dentry) 2045 2046 goto out2; /* not a mountpoint */ ··· 2061 2062 } else if (!is_subdir(old_nd.path.dentry, new_nd.path.dentry)) 2062 2063 goto out3; 2063 2064 detach_mnt(new_nd.path.mnt, &parent_path); 2064 - detach_mnt(user_nd.path.mnt, &root_parent); 2065 + detach_mnt(root.mnt, &root_parent); 2065 2066 /* mount old root on put_old */ 2066 - attach_mnt(user_nd.path.mnt, &old_nd.path); 2067 + attach_mnt(root.mnt, &old_nd.path); 2067 2068 /* mount new_root on / */ 2068 2069 attach_mnt(new_nd.path.mnt, &root_parent); 2069 2070 touch_mnt_namespace(current->nsproxy->mnt_ns); 2070 2071 spin_unlock(&vfsmount_lock); 2071 - chroot_fs_refs(&user_nd.path, &new_nd.path); 2072 - security_sb_post_pivotroot(&user_nd, &new_nd); 2072 + chroot_fs_refs(&root, &new_nd.path); 2073 + security_sb_post_pivotroot(&root, &new_nd.path); 2073 2074 error = 0; 2074 2075 path_put(&root_parent); 2075 2076 path_put(&parent_path); 2076 2077 out2: 2077 2078 mutex_unlock(&old_nd.path.dentry->d_inode->i_mutex); 2078 2079 up_write(&namespace_sem); 2079 - path_put(&user_nd.path); 2080 + path_put(&root); 2080 2081 path_put(&old_nd.path); 2081 2082 out1: 2082 2083 path_put(&new_nd.path); 2083 2084 out0: 2084 - unlock_kernel(); 2085 2085 return error; 2086 2086 out3: 2087 2087 spin_unlock(&vfsmount_lock);
+3
fs/pipe.c
··· 988 988 return f; 989 989 990 990 err_dentry: 991 + free_pipe_info(inode); 991 992 dput(dentry); 993 + return ERR_PTR(err); 994 + 992 995 err_inode: 993 996 free_pipe_info(inode); 994 997 iput(inode);
+2 -2
fs/pnode.c
··· 9 9 #include <linux/mnt_namespace.h> 10 10 #include <linux/mount.h> 11 11 #include <linux/fs.h> 12 + #include "internal.h" 12 13 #include "pnode.h" 13 14 14 15 /* return the next shared peer mount of @p */ ··· 212 211 out: 213 212 spin_lock(&vfsmount_lock); 214 213 while (!list_empty(&tmp_list)) { 215 - child = list_entry(tmp_list.next, struct vfsmount, mnt_hash); 216 - list_del_init(&child->mnt_hash); 214 + child = list_first_entry(&tmp_list, struct vfsmount, mnt_hash); 217 215 umount_tree(child, 0, &umount_list); 218 216 } 219 217 spin_unlock(&vfsmount_lock);
+1
fs/pnode.h
··· 35 35 struct list_head *); 36 36 int propagate_umount(struct list_head *); 37 37 int propagate_mount_busy(struct vfsmount *, int); 38 + void mnt_release_group_id(struct vfsmount *); 38 39 #endif /* _LINUX_PNODE_H */
+1 -3
fs/proc/base.c
··· 1626 1626 unsigned int fd, ino; 1627 1627 int retval; 1628 1628 struct files_struct * files; 1629 - struct fdtable *fdt; 1630 1629 1631 1630 retval = -ENOENT; 1632 1631 if (!p) ··· 1648 1649 if (!files) 1649 1650 goto out; 1650 1651 rcu_read_lock(); 1651 - fdt = files_fdtable(files); 1652 1652 for (fd = filp->f_pos-2; 1653 - fd < fdt->max_fds; 1653 + fd < files_fdtable(files)->max_fds; 1654 1654 fd++, filp->f_pos++) { 1655 1655 char name[PROC_NUMBUF]; 1656 1656 int len;
+12 -4
fs/seq_file.c
··· 25 25 * into the buffer. In case of error ->start() and ->next() return 26 26 * ERR_PTR(error). In the end of sequence they return %NULL. ->show() 27 27 * returns 0 in case of success and negative number in case of error. 28 + * Returning SEQ_SKIP means "discard this element and move on". 28 29 */ 29 30 int seq_open(struct file *file, const struct seq_operations *op) 30 31 { ··· 115 114 if (!p || IS_ERR(p)) 116 115 break; 117 116 err = m->op->show(m, p); 118 - if (err) 117 + if (err < 0) 119 118 break; 119 + if (unlikely(err)) 120 + m->count = 0; 120 121 if (m->count < m->size) 121 122 goto Fill; 122 123 m->op->stop(m, p); ··· 143 140 break; 144 141 } 145 142 err = m->op->show(m, p); 146 - if (err || m->count == m->size) { 143 + if (m->count == m->size || err) { 147 144 m->count = offs; 148 - break; 145 + if (likely(err <= 0)) 146 + break; 149 147 } 150 148 pos = next; 151 149 } ··· 203 199 if (IS_ERR(p)) 204 200 break; 205 201 error = m->op->show(m, p); 206 - if (error) 202 + if (error < 0) 207 203 break; 204 + if (unlikely(error)) { 205 + error = 0; 206 + m->count = 0; 207 + } 208 208 if (m->count == m->size) 209 209 goto Eoverflow; 210 210 if (pos + m->count > offset) {
+1
fs/super.c
··· 39 39 #include <linux/mutex.h> 40 40 #include <linux/file.h> 41 41 #include <asm/uaccess.h> 42 + #include "internal.h" 42 43 43 44 44 45 LIST_HEAD(super_blocks);
-1
include/linux/dcache.h
··· 359 359 } 360 360 361 361 extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); 362 - extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); 363 362 extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 364 363 365 364 extern int sysctl_vfs_cache_pressure;
-6
include/linux/fs.h
··· 305 305 306 306 extern void __init inode_init(void); 307 307 extern void __init inode_init_early(void); 308 - extern void __init mnt_init(void); 309 308 extern void __init files_init(unsigned long); 310 309 311 310 struct buffer_head; ··· 1535 1536 #define kern_mount(type) kern_mount_data(type, NULL) 1536 1537 extern int may_umount_tree(struct vfsmount *); 1537 1538 extern int may_umount(struct vfsmount *); 1538 - extern void umount_tree(struct vfsmount *, int, struct list_head *); 1539 - extern void release_mounts(struct list_head *); 1540 1539 extern long do_mount(char *, char *, char *, unsigned long, void *); 1541 - extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); 1542 - extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 1543 - struct vfsmount *); 1544 1540 extern struct vfsmount *collect_mounts(struct vfsmount *, struct dentry *); 1545 1541 extern void drop_collected_mounts(struct vfsmount *); 1546 1542
-2
include/linux/mount.h
··· 94 94 } 95 95 } 96 96 97 - extern void free_vfsmnt(struct vfsmount *mnt); 98 - extern struct vfsmount *alloc_vfsmnt(const char *name); 99 97 extern struct vfsmount *do_kern_mount(const char *fstype, int flags, 100 98 const char *name, void *data); 101 99
+26 -26
include/linux/security.h
··· 230 230 * loopback/bind mount (@flags & MS_BIND), @dev_name identifies the 231 231 * pathname of the object being mounted. 232 232 * @dev_name contains the name for object being mounted. 233 - * @nd contains the nameidata structure for mount point object. 233 + * @path contains the path for mount point object. 234 234 * @type contains the filesystem type. 235 235 * @flags contains the mount flags. 236 236 * @data contains the filesystem-specific data. ··· 249 249 * Check permission before the device with superblock @mnt->sb is mounted 250 250 * on the mount point named by @nd. 251 251 * @mnt contains the vfsmount for device being mounted. 252 - * @nd contains the nameidata object for the mount point. 252 + * @path contains the path for the mount point. 253 253 * Return 0 if permission is granted. 254 254 * @sb_umount: 255 255 * Check permission before the @mnt file system is unmounted. ··· 278 278 * This hook is called any time a mount is successfully grafetd to 279 279 * the tree. 280 280 * @mnt contains the mounted filesystem. 281 - * @mountpoint_nd contains the nameidata structure for the mount point. 281 + * @mountpoint contains the path for the mount point. 282 282 * @sb_pivotroot: 283 283 * Check permission before pivoting the root filesystem. 284 - * @old_nd contains the nameidata structure for the new location of the current root (put_old). 285 - * @new_nd contains the nameidata structure for the new root (new_root). 284 + * @old_path contains the path for the new location of the current root (put_old). 285 + * @new_path contains the path for the new root (new_root). 286 286 * Return 0 if permission is granted. 287 287 * @sb_post_pivotroot: 288 288 * Update module state after a successful pivot. 289 - * @old_nd contains the nameidata structure for the old root. 290 - * @new_nd contains the nameidata structure for the new root. 289 + * @old_path contains the path for the old root. 290 + * @new_path contains the path for the new root. 291 291 * @sb_get_mnt_opts: 292 292 * Get the security relevant mount options used for a superblock 293 293 * @sb the superblock to get security mount options from ··· 1315 1315 int (*sb_copy_data)(char *orig, char *copy); 1316 1316 int (*sb_kern_mount) (struct super_block *sb, void *data); 1317 1317 int (*sb_statfs) (struct dentry *dentry); 1318 - int (*sb_mount) (char *dev_name, struct nameidata * nd, 1318 + int (*sb_mount) (char *dev_name, struct path *path, 1319 1319 char *type, unsigned long flags, void *data); 1320 - int (*sb_check_sb) (struct vfsmount * mnt, struct nameidata * nd); 1320 + int (*sb_check_sb) (struct vfsmount * mnt, struct path *path); 1321 1321 int (*sb_umount) (struct vfsmount * mnt, int flags); 1322 1322 void (*sb_umount_close) (struct vfsmount * mnt); 1323 1323 void (*sb_umount_busy) (struct vfsmount * mnt); 1324 1324 void (*sb_post_remount) (struct vfsmount * mnt, 1325 1325 unsigned long flags, void *data); 1326 1326 void (*sb_post_addmount) (struct vfsmount * mnt, 1327 - struct nameidata * mountpoint_nd); 1328 - int (*sb_pivotroot) (struct nameidata * old_nd, 1329 - struct nameidata * new_nd); 1330 - void (*sb_post_pivotroot) (struct nameidata * old_nd, 1331 - struct nameidata * new_nd); 1327 + struct path *mountpoint); 1328 + int (*sb_pivotroot) (struct path *old_path, 1329 + struct path *new_path); 1330 + void (*sb_post_pivotroot) (struct path *old_path, 1331 + struct path *new_path); 1332 1332 int (*sb_get_mnt_opts) (const struct super_block *sb, 1333 1333 struct security_mnt_opts *opts); 1334 1334 int (*sb_set_mnt_opts) (struct super_block *sb, ··· 1593 1593 int security_sb_copy_data(char *orig, char *copy); 1594 1594 int security_sb_kern_mount(struct super_block *sb, void *data); 1595 1595 int security_sb_statfs(struct dentry *dentry); 1596 - int security_sb_mount(char *dev_name, struct nameidata *nd, 1596 + int security_sb_mount(char *dev_name, struct path *path, 1597 1597 char *type, unsigned long flags, void *data); 1598 - int security_sb_check_sb(struct vfsmount *mnt, struct nameidata *nd); 1598 + int security_sb_check_sb(struct vfsmount *mnt, struct path *path); 1599 1599 int security_sb_umount(struct vfsmount *mnt, int flags); 1600 1600 void security_sb_umount_close(struct vfsmount *mnt); 1601 1601 void security_sb_umount_busy(struct vfsmount *mnt); 1602 1602 void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *data); 1603 - void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd); 1604 - int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd); 1605 - void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd); 1603 + void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint); 1604 + int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1605 + void security_sb_post_pivotroot(struct path *old_path, struct path *new_path); 1606 1606 int security_sb_get_mnt_opts(const struct super_block *sb, 1607 1607 struct security_mnt_opts *opts); 1608 1608 int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); ··· 1872 1872 return 0; 1873 1873 } 1874 1874 1875 - static inline int security_sb_mount (char *dev_name, struct nameidata *nd, 1875 + static inline int security_sb_mount (char *dev_name, struct path *path, 1876 1876 char *type, unsigned long flags, 1877 1877 void *data) 1878 1878 { ··· 1880 1880 } 1881 1881 1882 1882 static inline int security_sb_check_sb (struct vfsmount *mnt, 1883 - struct nameidata *nd) 1883 + struct path *path) 1884 1884 { 1885 1885 return 0; 1886 1886 } ··· 1901 1901 { } 1902 1902 1903 1903 static inline void security_sb_post_addmount (struct vfsmount *mnt, 1904 - struct nameidata *mountpoint_nd) 1904 + struct path *mountpoint) 1905 1905 { } 1906 1906 1907 - static inline int security_sb_pivotroot (struct nameidata *old_nd, 1908 - struct nameidata *new_nd) 1907 + static inline int security_sb_pivotroot (struct path *old_path, 1908 + struct path *new_path) 1909 1909 { 1910 1910 return 0; 1911 1911 } 1912 1912 1913 - static inline void security_sb_post_pivotroot (struct nameidata *old_nd, 1914 - struct nameidata *new_nd) 1913 + static inline void security_sb_post_pivotroot (struct path *old_path, 1914 + struct path *new_path) 1915 1915 { } 1916 1916 static inline int security_sb_get_mnt_opts(const struct super_block *sb, 1917 1917 struct security_mnt_opts *opts)
+2
include/linux/seq_file.h
··· 30 30 int (*show) (struct seq_file *m, void *v); 31 31 }; 32 32 33 + #define SEQ_SKIP 1 34 + 33 35 int seq_open(struct file *, const struct seq_operations *); 34 36 ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); 35 37 loff_t seq_lseek(struct file *, loff_t, int);
+6 -21
kernel/exit.c
··· 521 521 } 522 522 EXPORT_SYMBOL(reset_files_struct); 523 523 524 - static void __exit_files(struct task_struct *tsk) 524 + void exit_files(struct task_struct *tsk) 525 525 { 526 526 struct files_struct * files = tsk->files; 527 527 ··· 533 533 } 534 534 } 535 535 536 - void exit_files(struct task_struct *tsk) 537 - { 538 - __exit_files(tsk); 539 - } 540 - 541 - static void __put_fs_struct(struct fs_struct *fs) 536 + void put_fs_struct(struct fs_struct *fs) 542 537 { 543 538 /* No need to hold fs->lock if we are killing it */ 544 539 if (atomic_dec_and_test(&fs->count)) { ··· 545 550 } 546 551 } 547 552 548 - void put_fs_struct(struct fs_struct *fs) 549 - { 550 - __put_fs_struct(fs); 551 - } 552 - 553 - static void __exit_fs(struct task_struct *tsk) 553 + void exit_fs(struct task_struct *tsk) 554 554 { 555 555 struct fs_struct * fs = tsk->fs; 556 556 ··· 553 563 task_lock(tsk); 554 564 tsk->fs = NULL; 555 565 task_unlock(tsk); 556 - __put_fs_struct(fs); 566 + put_fs_struct(fs); 557 567 } 558 - } 559 - 560 - void exit_fs(struct task_struct *tsk) 561 - { 562 - __exit_fs(tsk); 563 568 } 564 569 565 570 EXPORT_SYMBOL_GPL(exit_fs); ··· 952 967 if (group_dead) 953 968 acct_process(); 954 969 exit_sem(tsk); 955 - __exit_files(tsk); 956 - __exit_fs(tsk); 970 + exit_files(tsk); 971 + exit_fs(tsk); 957 972 check_stack_usage(); 958 973 exit_thread(); 959 974 cgroup_exit(tsk, 1);
+5 -5
security/dummy.c
··· 196 196 return 0; 197 197 } 198 198 199 - static int dummy_sb_mount (char *dev_name, struct nameidata *nd, char *type, 199 + static int dummy_sb_mount (char *dev_name, struct path *path, char *type, 200 200 unsigned long flags, void *data) 201 201 { 202 202 return 0; 203 203 } 204 204 205 - static int dummy_sb_check_sb (struct vfsmount *mnt, struct nameidata *nd) 205 + static int dummy_sb_check_sb (struct vfsmount *mnt, struct path *path) 206 206 { 207 207 return 0; 208 208 } ··· 229 229 } 230 230 231 231 232 - static void dummy_sb_post_addmount (struct vfsmount *mnt, struct nameidata *nd) 232 + static void dummy_sb_post_addmount (struct vfsmount *mnt, struct path *path) 233 233 { 234 234 return; 235 235 } 236 236 237 - static int dummy_sb_pivotroot (struct nameidata *old_nd, struct nameidata *new_nd) 237 + static int dummy_sb_pivotroot (struct path *old_path, struct path *new_path) 238 238 { 239 239 return 0; 240 240 } 241 241 242 - static void dummy_sb_post_pivotroot (struct nameidata *old_nd, struct nameidata *new_nd) 242 + static void dummy_sb_post_pivotroot (struct path *old_path, struct path *new_path) 243 243 { 244 244 return; 245 245 }
+10 -10
security/security.c
··· 296 296 return security_ops->sb_statfs(dentry); 297 297 } 298 298 299 - int security_sb_mount(char *dev_name, struct nameidata *nd, 299 + int security_sb_mount(char *dev_name, struct path *path, 300 300 char *type, unsigned long flags, void *data) 301 301 { 302 - return security_ops->sb_mount(dev_name, nd, type, flags, data); 302 + return security_ops->sb_mount(dev_name, path, type, flags, data); 303 303 } 304 304 305 - int security_sb_check_sb(struct vfsmount *mnt, struct nameidata *nd) 305 + int security_sb_check_sb(struct vfsmount *mnt, struct path *path) 306 306 { 307 - return security_ops->sb_check_sb(mnt, nd); 307 + return security_ops->sb_check_sb(mnt, path); 308 308 } 309 309 310 310 int security_sb_umount(struct vfsmount *mnt, int flags) ··· 327 327 security_ops->sb_post_remount(mnt, flags, data); 328 328 } 329 329 330 - void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd) 330 + void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint) 331 331 { 332 - security_ops->sb_post_addmount(mnt, mountpoint_nd); 332 + security_ops->sb_post_addmount(mnt, mountpoint); 333 333 } 334 334 335 - int security_sb_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd) 335 + int security_sb_pivotroot(struct path *old_path, struct path *new_path) 336 336 { 337 - return security_ops->sb_pivotroot(old_nd, new_nd); 337 + return security_ops->sb_pivotroot(old_path, new_path); 338 338 } 339 339 340 - void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_nd) 340 + void security_sb_post_pivotroot(struct path *old_path, struct path *new_path) 341 341 { 342 - security_ops->sb_post_pivotroot(old_nd, new_nd); 342 + security_ops->sb_post_pivotroot(old_path, new_path); 343 343 } 344 344 345 345 int security_sb_get_mnt_opts(const struct super_block *sb,
+4 -4
security/selinux/hooks.c
··· 2401 2401 } 2402 2402 2403 2403 static int selinux_mount(char *dev_name, 2404 - struct nameidata *nd, 2404 + struct path *path, 2405 2405 char *type, 2406 2406 unsigned long flags, 2407 2407 void *data) 2408 2408 { 2409 2409 int rc; 2410 2410 2411 - rc = secondary_ops->sb_mount(dev_name, nd, type, flags, data); 2411 + rc = secondary_ops->sb_mount(dev_name, path, type, flags, data); 2412 2412 if (rc) 2413 2413 return rc; 2414 2414 2415 2415 if (flags & MS_REMOUNT) 2416 - return superblock_has_perm(current, nd->path.mnt->mnt_sb, 2416 + return superblock_has_perm(current, path->mnt->mnt_sb, 2417 2417 FILESYSTEM__REMOUNT, NULL); 2418 2418 else 2419 - return dentry_has_perm(current, nd->path.mnt, nd->path.dentry, 2419 + return dentry_has_perm(current, path->mnt, path->dentry, 2420 2420 FILE__MOUNTON); 2421 2421 } 2422 2422
+2 -2
security/smack/smack_lsm.c
··· 315 315 * Returns 0 if current can write the floor of the filesystem 316 316 * being mounted on, an error code otherwise. 317 317 */ 318 - static int smack_sb_mount(char *dev_name, struct nameidata *nd, 318 + static int smack_sb_mount(char *dev_name, struct path *path, 319 319 char *type, unsigned long flags, void *data) 320 320 { 321 - struct superblock_smack *sbp = nd->path.mnt->mnt_sb->s_security; 321 + struct superblock_smack *sbp = path->mnt->mnt_sb->s_security; 322 322 323 323 return smk_curacc(sbp->smk_floor, MAY_WRITE); 324 324 }