aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 0b515ac53134..995cba3c62b8 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -127,7 +127,7 @@ asmlinkage long sys_uselib(const char __user * library)
127 struct nameidata nd; 127 struct nameidata nd;
128 int error; 128 int error;
129 129
130 error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd, FMODE_READ); 130 error = __user_path_lookup_open(library, LOOKUP_FOLLOW, &nd, FMODE_READ|FMODE_EXEC);
131 if (error) 131 if (error)
132 goto out; 132 goto out;
133 133
@@ -477,7 +477,7 @@ struct file *open_exec(const char *name)
477 int err; 477 int err;
478 struct file *file; 478 struct file *file;
479 479
480 err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd, FMODE_READ); 480 err = path_lookup_open(AT_FDCWD, name, LOOKUP_FOLLOW, &nd, FMODE_READ|FMODE_EXEC);
481 file = ERR_PTR(err); 481 file = ERR_PTR(err);
482 482
483 if (!err) { 483 if (!err) {
@@ -1143,10 +1143,9 @@ int do_execve(char * filename,
1143 int i; 1143 int i;
1144 1144
1145 retval = -ENOMEM; 1145 retval = -ENOMEM;
1146 bprm = kmalloc(sizeof(*bprm), GFP_KERNEL); 1146 bprm = kzalloc(sizeof(*bprm), GFP_KERNEL);
1147 if (!bprm) 1147 if (!bprm)
1148 goto out_ret; 1148 goto out_ret;
1149 memset(bprm, 0, sizeof(*bprm));
1150 1149
1151 file = open_exec(filename); 1150 file = open_exec(filename);
1152 retval = PTR_ERR(file); 1151 retval = PTR_ERR(file);