diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 616f41a7cde6..437195f204e1 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1803,7 +1803,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1803 | rcu_read_lock(); | 1803 | rcu_read_lock(); |
1804 | file = fcheck_files(files, fd); | 1804 | file = fcheck_files(files, fd); |
1805 | if (file) { | 1805 | if (file) { |
1806 | unsigned i_mode, f_mode = file->f_mode; | 1806 | unsigned f_mode = file->f_mode; |
1807 | 1807 | ||
1808 | rcu_read_unlock(); | 1808 | rcu_read_unlock(); |
1809 | put_files_struct(files); | 1809 | put_files_struct(files); |
@@ -1819,12 +1819,14 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1819 | inode->i_gid = GLOBAL_ROOT_GID; | 1819 | inode->i_gid = GLOBAL_ROOT_GID; |
1820 | } | 1820 | } |
1821 | 1821 | ||
1822 | i_mode = S_IFLNK; | 1822 | if (S_ISLNK(inode->i_mode)) { |
1823 | if (f_mode & FMODE_READ) | 1823 | unsigned i_mode = S_IFLNK; |
1824 | i_mode |= S_IRUSR | S_IXUSR; | 1824 | if (f_mode & FMODE_READ) |
1825 | if (f_mode & FMODE_WRITE) | 1825 | i_mode |= S_IRUSR | S_IXUSR; |
1826 | i_mode |= S_IWUSR | S_IXUSR; | 1826 | if (f_mode & FMODE_WRITE) |
1827 | inode->i_mode = i_mode; | 1827 | i_mode |= S_IWUSR | S_IXUSR; |
1828 | inode->i_mode = i_mode; | ||
1829 | } | ||
1828 | 1830 | ||
1829 | security_task_to_inode(task, inode); | 1831 | security_task_to_inode(task, inode); |
1830 | put_task_struct(task); | 1832 | put_task_struct(task); |
@@ -1859,6 +1861,7 @@ static struct dentry *proc_fd_instantiate(struct inode *dir, | |||
1859 | ei = PROC_I(inode); | 1861 | ei = PROC_I(inode); |
1860 | ei->fd = fd; | 1862 | ei->fd = fd; |
1861 | 1863 | ||
1864 | inode->i_mode = S_IFLNK; | ||
1862 | inode->i_op = &proc_pid_link_inode_operations; | 1865 | inode->i_op = &proc_pid_link_inode_operations; |
1863 | inode->i_size = 64; | 1866 | inode->i_size = 64; |
1864 | ei->op.proc_get_link = proc_fd_link; | 1867 | ei->op.proc_get_link = proc_fd_link; |