aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/exec.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 4e834f16d9da..ec5df9a38313 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1159,6 +1159,7 @@ EXPORT_SYMBOL(remove_arg_zero);
1159 */ 1159 */
1160int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) 1160int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1161{ 1161{
1162 unsigned int depth = bprm->recursion_depth;
1162 int try,retval; 1163 int try,retval;
1163 struct linux_binfmt *fmt; 1164 struct linux_binfmt *fmt;
1164#ifdef __alpha__ 1165#ifdef __alpha__
@@ -1219,8 +1220,15 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1219 continue; 1220 continue;
1220 read_unlock(&binfmt_lock); 1221 read_unlock(&binfmt_lock);
1221 retval = fn(bprm, regs); 1222 retval = fn(bprm, regs);
1223 /*
1224 * Restore the depth counter to its starting value
1225 * in this call, so we don't have to rely on every
1226 * load_binary function to restore it on return.
1227 */
1228 bprm->recursion_depth = depth;
1222 if (retval >= 0) { 1229 if (retval >= 0) {
1223 tracehook_report_exec(fmt, bprm, regs); 1230 if (depth == 0)
1231 tracehook_report_exec(fmt, bprm, regs);
1224 put_binfmt(fmt); 1232 put_binfmt(fmt);
1225 allow_write_access(bprm->file); 1233 allow_write_access(bprm->file);
1226 if (bprm->file) 1234 if (bprm->file)