projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[firefly-linux-kernel-4.4.55.git]
/
fs
/
binfmt_script.c
diff --git
a/fs/binfmt_script.c
b/fs/binfmt_script.c
index d3b8c1f6315554df64d3491b52d83d2a73f4a359..5027a3e149222bd5945c87d9521e6e7a6108dc77 100644
(file)
--- a/
fs/binfmt_script.c
+++ b/
fs/binfmt_script.c
@@
-14,7
+14,7
@@
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/err.h>
#include <linux/fs.h>
-static int load_script(struct linux_binprm *bprm
,struct pt_regs *regs
)
+static int load_script(struct linux_binprm *bprm)
{
const char *i_arg, *i_name;
char *cp;
{
const char *i_arg, *i_name;
char *cp;
@@
-22,15
+22,13
@@
static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
char interp[BINPRM_BUF_SIZE];
int retval;
char interp[BINPRM_BUF_SIZE];
int retval;
- if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') ||
- (bprm->recursion_depth > BINPRM_MAX_RECURSION))
+ if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!'))
return -ENOEXEC;
/*
* This section does the #! interpretation.
* Sorta complicated, but hopefully it will work. -TYT
*/
return -ENOEXEC;
/*
* This section does the #! interpretation.
* Sorta complicated, but hopefully it will work. -TYT
*/
- bprm->recursion_depth++;
allow_write_access(bprm->file);
fput(bprm->file);
bprm->file = NULL;
allow_write_access(bprm->file);
fput(bprm->file);
bprm->file = NULL;
@@
-82,7
+80,9
@@
static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
retval = copy_strings_kernel(1, &i_name, bprm);
if (retval) return retval;
bprm->argc++;
retval = copy_strings_kernel(1, &i_name, bprm);
if (retval) return retval;
bprm->argc++;
- bprm->interp = interp;
+ retval = bprm_change_interp(interp, bprm);
+ if (retval < 0)
+ return retval;
/*
* OK, now restart the process with the interpreter's dentry.
/*
* OK, now restart the process with the interpreter's dentry.
@@
-95,7
+95,7
@@
static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
retval = prepare_binprm(bprm);
if (retval < 0)
return retval;
retval = prepare_binprm(bprm);
if (retval < 0)
return retval;
- return search_binary_handler(bprm
,regs
);
+ return search_binary_handler(bprm);
}
static struct linux_binfmt script_format = {
}
static struct linux_binfmt script_format = {