]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/namei.c
UBUNTU: Ubuntu-4.13.0-45.50
[mirror_ubuntu-artful-kernel.git] / fs / namei.c
index e0b46eb0e2129ca337bba8e4634d96edf0683117..51bcb966a76bf6651e388ba5070184d1fc5a16e1 100644 (file)
@@ -524,7 +524,7 @@ struct nameidata {
        struct inode    *link_inode;
        unsigned        root_seq;
        int             dfd;
-};
+} __randomize_layout;
 
 static void set_nameidata(struct nameidata *p, int dfd, struct filename *name)
 {
@@ -900,8 +900,8 @@ static inline void put_link(struct nameidata *nd)
                path_put(&last->link);
 }
 
-int sysctl_protected_symlinks __read_mostly = 0;
-int sysctl_protected_hardlinks __read_mostly = 0;
+int sysctl_protected_symlinks __read_mostly = 1;
+int sysctl_protected_hardlinks __read_mostly = 1;
 
 /**
  * may_follow_link - Check symlink following for unsafe situations
@@ -3400,7 +3400,6 @@ out:
 
 struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode, int open_flag)
 {
-       static const struct qstr name = QSTR_INIT("/", 1);
        struct dentry *child = NULL;
        struct inode *dir = dentry->d_inode;
        struct inode *inode;
@@ -3414,7 +3413,7 @@ struct dentry *vfs_tmpfile(struct dentry *dentry, umode_t mode, int open_flag)
        if (!dir->i_op->tmpfile)
                goto out_err;
        error = -ENOMEM;
-       child = d_alloc(dentry, &name);
+       child = d_alloc(dentry, &slash_name);
        if (unlikely(!child))
                goto out_err;
        error = dir->i_op->tmpfile(dir, child, mode);