summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/open.c b/fs/open.c
index 0285ce7dbd51..f1c2f855fd43 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -733,6 +733,12 @@ static int do_dentry_open(struct file *f,
733 return 0; 733 return 0;
734 } 734 }
735 735
736 /* Any file opened for execve()/uselib() has to be a regular file. */
737 if (unlikely(f->f_flags & FMODE_EXEC && !S_ISREG(inode->i_mode))) {
738 error = -EACCES;
739 goto cleanup_file;
740 }
741
736 if (f->f_mode & FMODE_WRITE && !special_file(inode->i_mode)) { 742 if (f->f_mode & FMODE_WRITE && !special_file(inode->i_mode)) {
737 error = get_write_access(inode); 743 error = get_write_access(inode);
738 if (unlikely(error)) 744 if (unlikely(error))