projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
binfmt_misc.c: avoid potential kernel stack overflow
[linux-2.6-block.git]
/
fs
/
binfmt_misc.c
diff --git
a/fs/binfmt_misc.c
b/fs/binfmt_misc.c
index dbf0ac0523de14d49edcc58b43ab7c62a407e406..7191306367c5d11912ceed01c5fce4925b528eba 100644
(file)
--- a/
fs/binfmt_misc.c
+++ b/
fs/binfmt_misc.c
@@
-115,6
+115,12
@@
static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
if (!enabled)
goto _ret;
+ retval = -ENOEXEC;
+ if (bprm->misc_bang)
+ goto _ret;
+
+ bprm->misc_bang = 1;
+
/* to keep locking time low, we copy the interpreter string */
read_lock(&entries_lock);
fmt = check_file(bprm);