aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/open.c b/fs/open.c
index b2e4c93aed03..8e02d42bfe44 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -501,12 +501,11 @@ asmlinkage long sys_chdir(const char __user * filename)
501 struct nameidata nd; 501 struct nameidata nd;
502 int error; 502 int error;
503 503
504 error = __user_walk(filename, 504 error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
505 LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_CHDIR, &nd);
506 if (error) 505 if (error)
507 goto out; 506 goto out;
508 507
509 error = vfs_permission(&nd, MAY_EXEC); 508 error = vfs_permission(&nd, MAY_EXEC | MAY_CHDIR);
510 if (error) 509 if (error)
511 goto dput_and_out; 510 goto dput_and_out;
512 511