exec: use -ELOOP for max recursion depth
[firefly-linux-kernel-4.4.55.git] / fs / binfmt_script.c
index 8c954997e7f73a22b39718a9564c0c9ed3465a58..1610a91637e57d88c54b1a88d6a3ba1e4a230ac4 100644 (file)
@@ -22,15 +22,13 @@ static int load_script(struct linux_binprm *bprm)
        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
         */
 
-       bprm->recursion_depth++;
        allow_write_access(bprm->file);
        fput(bprm->file);
        bprm->file = NULL;