]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/binfmt_misc.c
[SCSI] refactor sdev/starget/shost busy checking
[linux-2.6-omap-h63xx.git] / fs / binfmt_misc.c
index 756205314c24401fc31ebbb6eb7c479aa4c92145..f2744ab4e5b35c415724034f3f5a3a328997cf99 100644 (file)
@@ -117,11 +117,9 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                goto _ret;
 
        retval = -ENOEXEC;
-       if (bprm->misc_bang)
+       if (bprm->recursion_depth > BINPRM_MAX_RECURSION)
                goto _ret;
 
-       bprm->misc_bang = 1;
-
        /* to keep locking time low, we copy the interpreter string */
        read_lock(&entries_lock);
        fmt = check_file(bprm);
@@ -199,6 +197,8 @@ 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);
        if (retval < 0)
                goto _error;