skas-prevent-tail-call Signed-off-by: Paolo 'Blaisorblade' Giarrusso Index: linux-2.6.14/arch/i386/kernel/sys_i386.c =================================================================== --- linux-2.6.14.orig/arch/i386/kernel/sys_i386.c 2005-10-29 05:50:06.000000000 +0200 +++ linux-2.6.14/arch/i386/kernel/sys_i386.c 2005-10-29 05:50:28.000000000 +0200 @@ -70,7 +70,12 @@ 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 @@ 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; }