Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- clean-linux-2.6.11-paolo/arch/i386/kernel/sys_i386.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-) diff -puN arch/i386/kernel/sys_i386.c~skas-prevent-tail-call arch/i386/kernel/sys_i386.c --- clean-linux-2.6.11/arch/i386/kernel/sys_i386.c~skas-prevent-tail-call 2005-07-10 16:56:25.000000000 +0200 +++ clean-linux-2.6.11-paolo/arch/i386/kernel/sys_i386.c 2005-07-10 16:56:25.000000000 +0200 @@ -70,7 +70,12 @@ asmlinkage long sys_mmap2(unsigned long unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) { - return do_mmap2(current->mm, addr, len, prot, flags, fd, pgoff); + long ret = do_mmap2(current->mm, addr, len, prot, flags, fd, pgoff); + + /* A tail call would reorder parameters on the stack and they would then + * be restored at the wrong places. */ + prevent_tail_call(ret); + return ret; } /* @@ -102,6 +107,9 @@ asmlinkage int old_mmap(struct mmap_arg_ goto out; err = do_mmap2(current->mm, a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); + /* A tail call would reorder parameters on the stack and they would then + * be restored at the wrong places. */ + prevent_tail_call(err); out: return err; } _