Merge branch 'to-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland

* 'to-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/frob/linux-2.6-roland:
  tracehook: exec double-reporting fix
This commit is contained in:
Linus Torvalds 2008-12-10 14:40:21 -08:00
Родитель 711a49a07f 85f334666a
Коммит f4fd2c5b6f
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -1159,6 +1159,7 @@ EXPORT_SYMBOL(remove_arg_zero);
*/ */
int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
{ {
unsigned int depth = bprm->recursion_depth;
int try,retval; int try,retval;
struct linux_binfmt *fmt; struct linux_binfmt *fmt;
#ifdef __alpha__ #ifdef __alpha__
@ -1219,7 +1220,14 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
continue; continue;
read_unlock(&binfmt_lock); read_unlock(&binfmt_lock);
retval = fn(bprm, regs); retval = fn(bprm, regs);
/*
* Restore the depth counter to its starting value
* in this call, so we don't have to rely on every
* load_binary function to restore it on return.
*/
bprm->recursion_depth = depth;
if (retval >= 0) { if (retval >= 0) {
if (depth == 0)
tracehook_report_exec(fmt, bprm, regs); tracehook_report_exec(fmt, bprm, regs);
put_binfmt(fmt); put_binfmt(fmt);
allow_write_access(bprm->file); allow_write_access(bprm->file);