]>
Commit | Line | Data |
---|---|---|
4d1e5b62 AF |
1 | From: Andreas Gruenbacher <agruen@suse.de> |
2 | Subject: Switch to vfs_permission() in do_path_lookup() | |
3 | ||
4 | Switch from file_permission() to vfs_permission() in do_path_lookup(): | |
5 | this avoids calling permission() with a NULL nameidata here. | |
6 | ||
7 | Signed-off-by: Andreas Gruenbacher <agruen@suse.de> | |
8 | Signed-off-by: John Johansen <jjohansen@suse.de> | |
9 | ||
10 | --- | |
11 | fs/namei.c | 7 ++----- | |
12 | 1 file changed, 2 insertions(+), 5 deletions(-) | |
13 | ||
14 | --- a/fs/namei.c | |
15 | +++ b/fs/namei.c | |
16 | @@ -1085,24 +1085,21 @@ static int do_path_lookup(int dfd, const | |
17 | path_get(&fs->pwd); | |
18 | read_unlock(&fs->lock); | |
19 | } else { | |
20 | - struct dentry *dentry; | |
21 | - | |
22 | file = fget_light(dfd, &fput_needed); | |
23 | retval = -EBADF; | |
24 | if (!file) | |
25 | goto out_fail; | |
26 | ||
27 | - dentry = file->f_path.dentry; | |
28 | + nd->path = file->f_path; | |
29 | ||
30 | retval = -ENOTDIR; | |
31 | - if (!S_ISDIR(dentry->d_inode->i_mode)) | |
32 | + if (!S_ISDIR(nd->path.dentry->d_inode->i_mode)) | |
33 | goto fput_fail; | |
34 | ||
35 | retval = file_permission(file, MAY_EXEC); | |
36 | if (retval) | |
37 | goto fput_fail; | |
38 | ||
39 | - nd->path = file->f_path; | |
40 | path_get(&file->f_path); | |
41 | ||
42 | fput_light(file, fput_needed); |