diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 1b0f470a3e35..2cf5d7e37375 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1564,12 +1564,16 @@ static int proc_exe_link(struct dentry *dentry, struct path *exe_path) | |||
1564 | return -ENOENT; | 1564 | return -ENOENT; |
1565 | } | 1565 | } |
1566 | 1566 | ||
1567 | static const char *proc_pid_follow_link(struct dentry *dentry, void **cookie) | 1567 | static const char *proc_pid_get_link(struct dentry *dentry, |
1568 | struct inode *inode, | ||
1569 | struct delayed_call *done) | ||
1568 | { | 1570 | { |
1569 | struct inode *inode = d_inode(dentry); | ||
1570 | struct path path; | 1571 | struct path path; |
1571 | int error = -EACCES; | 1572 | int error = -EACCES; |
1572 | 1573 | ||
1574 | if (!dentry) | ||
1575 | return ERR_PTR(-ECHILD); | ||
1576 | |||
1573 | /* Are we allowed to snoop on the tasks file descriptors? */ | 1577 | /* Are we allowed to snoop on the tasks file descriptors? */ |
1574 | if (!proc_fd_access_allowed(inode)) | 1578 | if (!proc_fd_access_allowed(inode)) |
1575 | goto out; | 1579 | goto out; |
@@ -1630,7 +1634,7 @@ out: | |||
1630 | 1634 | ||
1631 | const struct inode_operations proc_pid_link_inode_operations = { | 1635 | const struct inode_operations proc_pid_link_inode_operations = { |
1632 | .readlink = proc_pid_readlink, | 1636 | .readlink = proc_pid_readlink, |
1633 | .follow_link = proc_pid_follow_link, | 1637 | .get_link = proc_pid_get_link, |
1634 | .setattr = proc_setattr, | 1638 | .setattr = proc_setattr, |
1635 | }; | 1639 | }; |
1636 | 1640 | ||
@@ -1895,7 +1899,7 @@ static const struct dentry_operations tid_map_files_dentry_operations = { | |||
1895 | .d_delete = pid_delete_dentry, | 1899 | .d_delete = pid_delete_dentry, |
1896 | }; | 1900 | }; |
1897 | 1901 | ||
1898 | static int proc_map_files_get_link(struct dentry *dentry, struct path *path) | 1902 | static int map_files_get_link(struct dentry *dentry, struct path *path) |
1899 | { | 1903 | { |
1900 | unsigned long vm_start, vm_end; | 1904 | unsigned long vm_start, vm_end; |
1901 | struct vm_area_struct *vma; | 1905 | struct vm_area_struct *vma; |
@@ -1945,20 +1949,22 @@ struct map_files_info { | |||
1945 | * path to the file in question. | 1949 | * path to the file in question. |
1946 | */ | 1950 | */ |
1947 | static const char * | 1951 | static const char * |
1948 | proc_map_files_follow_link(struct dentry *dentry, void **cookie) | 1952 | proc_map_files_get_link(struct dentry *dentry, |
1953 | struct inode *inode, | ||
1954 | struct delayed_call *done) | ||
1949 | { | 1955 | { |
1950 | if (!capable(CAP_SYS_ADMIN)) | 1956 | if (!capable(CAP_SYS_ADMIN)) |
1951 | return ERR_PTR(-EPERM); | 1957 | return ERR_PTR(-EPERM); |
1952 | 1958 | ||
1953 | return proc_pid_follow_link(dentry, NULL); | 1959 | return proc_pid_get_link(dentry, inode, done); |
1954 | } | 1960 | } |
1955 | 1961 | ||
1956 | /* | 1962 | /* |
1957 | * Identical to proc_pid_link_inode_operations except for follow_link() | 1963 | * Identical to proc_pid_link_inode_operations except for get_link() |
1958 | */ | 1964 | */ |
1959 | static const struct inode_operations proc_map_files_link_inode_operations = { | 1965 | static const struct inode_operations proc_map_files_link_inode_operations = { |
1960 | .readlink = proc_pid_readlink, | 1966 | .readlink = proc_pid_readlink, |
1961 | .follow_link = proc_map_files_follow_link, | 1967 | .get_link = proc_map_files_get_link, |
1962 | .setattr = proc_setattr, | 1968 | .setattr = proc_setattr, |
1963 | }; | 1969 | }; |
1964 | 1970 | ||
@@ -1975,7 +1981,7 @@ proc_map_files_instantiate(struct inode *dir, struct dentry *dentry, | |||
1975 | return -ENOENT; | 1981 | return -ENOENT; |
1976 | 1982 | ||
1977 | ei = PROC_I(inode); | 1983 | ei = PROC_I(inode); |
1978 | ei->op.proc_get_link = proc_map_files_get_link; | 1984 | ei->op.proc_get_link = map_files_get_link; |
1979 | 1985 | ||
1980 | inode->i_op = &proc_map_files_link_inode_operations; | 1986 | inode->i_op = &proc_map_files_link_inode_operations; |
1981 | inode->i_size = 64; | 1987 | inode->i_size = 64; |