diff options
Diffstat (limited to 'fs/binfmt_misc.c')
| -rw-r--r-- | fs/binfmt_misc.c | 15 | 
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 790b3cddca6..0c8869fdd14 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -104,7 +104,7 @@ static Node *check_file(struct linux_binprm *bprm)  /*   * the loader itself   */ -static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs) +static int load_misc_binary(struct linux_binprm *bprm)  {  	Node *fmt;  	struct file * interp_file = NULL; @@ -117,10 +117,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)  	if (!enabled)  		goto _ret; -	retval = -ENOEXEC; -	if (bprm->recursion_depth > BINPRM_MAX_RECURSION) -		goto _ret; -  	/* to keep locking time low, we copy the interpreter string */  	read_lock(&entries_lock);  	fmt = check_file(bprm); @@ -176,7 +172,10 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)  		goto _error;  	bprm->argc ++; -	bprm->interp = iname;	/* for binfmt_script */ +	/* Update interp in case binfmt_script needs it. */ +	retval = bprm_change_interp(iname, bprm); +	if (retval < 0) +		goto _error;  	interp_file = open_exec (iname);  	retval = PTR_ERR (interp_file); @@ -197,9 +196,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)  	if (retval < 0)  		goto _error; -	bprm->recursion_depth++; - -	retval = search_binary_handler (bprm, regs); +	retval = search_binary_handler(bprm);  	if (retval < 0)  		goto _error;  |