author: Kees Cook <keescook@chromium.org> 2012-12-17 16:03:20 -0800
committer: Linus Torvalds <torvalds@linux-foundation.org> 2012-12-17 17:15:23 -0800
commit: d740269867021faf4ce38a449353d2b986c34a67
parent: 8d238027b87e654be552eabdf492042a34c5c300
Commit Summary:
Diffstat:
1 file changed, 1 insertion, 3 deletions
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c
index 8c954997e7f7..1610a91637e5 100644
--- a/fs/binfmt_script.c
+++ b/fs/binfmt_script.c
@@ -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;