1 From: Andreas Gruenbacher <agruen@suse.de>
2 Subject: Switch to vfs_permission() in do_path_lookup()
4 Switch from file_permission() to vfs_permission() in do_path_lookup():
5 this avoids calling permission() with a NULL nameidata here.
7 Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
8 Signed-off-by: John Johansen <jjohansen@suse.de>
11 fs/namei.c | 7 ++-----
12 1 file changed, 2 insertions(+), 5 deletions(-)
16 @@ -1085,24 +1085,21 @@ static int do_path_lookup(int dfd, const
18 read_unlock(&fs->lock);
20 - struct dentry *dentry;
22 file = fget_light(dfd, &fput_needed);
27 - dentry = file->f_path.dentry;
28 + nd->path = file->f_path;
31 - if (!S_ISDIR(dentry->d_inode->i_mode))
32 + if (!S_ISDIR(nd->path.dentry->d_inode->i_mode))
35 retval = file_permission(file, MAY_EXEC);
39 - nd->path = file->f_path;
40 path_get(&file->f_path);
42 fput_light(file, fput_needed);