aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 85f0a80912aa..dc5b2fcadc3b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1719,10 +1719,16 @@ static int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat
1719 */ 1719 */
1720static int pid_revalidate(struct dentry *dentry, struct nameidata *nd) 1720static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
1721{ 1721{
1722 struct inode *inode = dentry->d_inode; 1722 struct inode *inode;
1723 struct task_struct *task = get_proc_task(inode); 1723 struct task_struct *task;
1724 const struct cred *cred; 1724 const struct cred *cred;
1725 1725
1726 if (nd && nd->flags & LOOKUP_RCU)
1727 return -ECHILD;
1728
1729 inode = dentry->d_inode;
1730 task = get_proc_task(inode);
1731
1726 if (task) { 1732 if (task) {
1727 if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) || 1733 if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
1728 task_dumpable(task)) { 1734 task_dumpable(task)) {
@@ -1888,12 +1894,19 @@ static int proc_fd_link(struct inode *inode, struct path *path)
1888 1894
1889static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd) 1895static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
1890{ 1896{
1891 struct inode *inode = dentry->d_inode; 1897 struct inode *inode;
1892 struct task_struct *task = get_proc_task(inode); 1898 struct task_struct *task;
1893 int fd = proc_fd(inode); 1899 int fd;
1894 struct files_struct *files; 1900 struct files_struct *files;
1895 const struct cred *cred; 1901 const struct cred *cred;
1896 1902
1903 if (nd && nd->flags & LOOKUP_RCU)
1904 return -ECHILD;
1905
1906 inode = dentry->d_inode;
1907 task = get_proc_task(inode);
1908 fd = proc_fd(inode);
1909
1897 if (task) { 1910 if (task) {
1898 files = get_files_struct(task); 1911 files = get_files_struct(task);
1899 if (files) { 1912 if (files) {
@@ -2563,8 +2576,14 @@ static const struct pid_entry proc_base_stuff[] = {
2563 */ 2576 */
2564static int proc_base_revalidate(struct dentry *dentry, struct nameidata *nd) 2577static int proc_base_revalidate(struct dentry *dentry, struct nameidata *nd)
2565{ 2578{
2566 struct inode *inode = dentry->d_inode; 2579 struct inode *inode;
2567 struct task_struct *task = get_proc_task(inode); 2580 struct task_struct *task;
2581
2582 if (nd->flags & LOOKUP_RCU)
2583 return -ECHILD;
2584
2585 inode = dentry->d_inode;
2586 task = get_proc_task(inode);
2568 if (task) { 2587 if (task) {
2569 put_task_struct(task); 2588 put_task_struct(task);
2570 return 1; 2589 return 1;