aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/open.c b/fs/open.c
index d3a2a00f52dc..3317e1909b2c 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -457,11 +457,11 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
457 old_cap = cap_set_effective(current->cap_permitted); 457 old_cap = cap_set_effective(current->cap_permitted);
458 } 458 }
459 459
460 res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW|LOOKUP_ACCESS, &nd); 460 res = __user_walk_fd(dfd, filename, LOOKUP_FOLLOW, &nd);
461 if (res) 461 if (res)
462 goto out; 462 goto out;
463 463
464 res = vfs_permission(&nd, mode); 464 res = vfs_permission(&nd, mode | MAY_ACCESS);
465 /* SuS v2 requires we report a read only fs too */ 465 /* SuS v2 requires we report a read only fs too */
466 if(res || !(mode & S_IWOTH) || 466 if(res || !(mode & S_IWOTH) ||
467 special_file(nd.path.dentry->d_inode->i_mode)) 467 special_file(nd.path.dentry->d_inode->i_mode))
@@ -505,7 +505,7 @@ asmlinkage long sys_chdir(const char __user * filename)
505 if (error) 505 if (error)
506 goto out; 506 goto out;
507 507
508 error = vfs_permission(&nd, MAY_EXEC | MAY_CHDIR); 508 error = vfs_permission(&nd, MAY_EXEC | MAY_ACCESS);
509 if (error) 509 if (error)
510 goto dput_and_out; 510 goto dput_and_out;
511 511
@@ -534,7 +534,7 @@ asmlinkage long sys_fchdir(unsigned int fd)
534 if (!S_ISDIR(inode->i_mode)) 534 if (!S_ISDIR(inode->i_mode))
535 goto out_putf; 535 goto out_putf;
536 536
537 error = file_permission(file, MAY_EXEC); 537 error = file_permission(file, MAY_EXEC | MAY_ACCESS);
538 if (!error) 538 if (!error)
539 set_fs_pwd(current->fs, &file->f_path); 539 set_fs_pwd(current->fs, &file->f_path);
540out_putf: 540out_putf:
@@ -552,7 +552,7 @@ asmlinkage long sys_chroot(const char __user * filename)
552 if (error) 552 if (error)
553 goto out; 553 goto out;
554 554
555 error = vfs_permission(&nd, MAY_EXEC); 555 error = vfs_permission(&nd, MAY_EXEC | MAY_ACCESS);
556 if (error) 556 if (error)
557 goto dput_and_out; 557 goto dput_and_out;
558 558