diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-17 02:27:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:52 -0400 |
commit | 1a159dd229e6a70e3ffd3f785cb51fa61b232279 (patch) | |
tree | 25d7596b718b37dccedc1a4486e4afc45e29a772 /fs/exec.c | |
parent | 22590e41cb569add194829c08dc0ceea74b38a65 (diff) |
exec: remove unnecessary check for MNT_NOEXEC
vfs_permission(MAY_EXEC) checks if the filesystem is mounted with "noexec", so
there's no need to repeat this check in sys_uselib() and open_exec().
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -112,9 +112,6 @@ asmlinkage long sys_uselib(const char __user * library) | |||
112 | if (error) | 112 | if (error) |
113 | goto out; | 113 | goto out; |
114 | 114 | ||
115 | error = -EACCES; | ||
116 | if (nd.mnt->mnt_flags & MNT_NOEXEC) | ||
117 | goto exit; | ||
118 | error = -EINVAL; | 115 | error = -EINVAL; |
119 | if (!S_ISREG(nd.dentry->d_inode->i_mode)) | 116 | if (!S_ISREG(nd.dentry->d_inode->i_mode)) |
120 | goto exit; | 117 | goto exit; |
@@ -658,8 +655,7 @@ struct file *open_exec(const char *name) | |||
658 | if (!err) { | 655 | if (!err) { |
659 | struct inode *inode = nd.dentry->d_inode; | 656 | struct inode *inode = nd.dentry->d_inode; |
660 | file = ERR_PTR(-EACCES); | 657 | file = ERR_PTR(-EACCES); |
661 | if (!(nd.mnt->mnt_flags & MNT_NOEXEC) && | 658 | if (S_ISREG(inode->i_mode)) { |
662 | S_ISREG(inode->i_mode)) { | ||
663 | int err = vfs_permission(&nd, MAY_EXEC); | 659 | int err = vfs_permission(&nd, MAY_EXEC); |
664 | file = ERR_PTR(err); | 660 | file = ERR_PTR(err); |
665 | if (!err) { | 661 | if (!err) { |