X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=fs%2Fbinfmt_misc.c;h=0c8869fdd14ebf9291eb700ccd099c910584910d;hb=3e36a16375eee390a9d80f99499fe630efa08128;hp=b0b70fbea06cb03e1adfe854a987f01bbf9956a9;hpb=2dfea3803dcf70983d14ce1dcbb3e97a7459a28b;p=karo-tx-linux.git diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index b0b70fbea06c..0c8869fdd14e 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -117,10 +117,6 @@ static int load_misc_binary(struct linux_binprm *bprm) 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) 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,8 +196,6 @@ static int load_misc_binary(struct linux_binprm *bprm) if (retval < 0) goto _error; - bprm->recursion_depth++; - retval = search_binary_handler(bprm); if (retval < 0) goto _error;