skas-prevent-tail-call-cont Signed-off-by: Paolo 'Blaisorblade' Giarrusso Index: linux-2.6.14/arch/i386/kernel/ldt.c =================================================================== --- linux-2.6.14.orig/arch/i386/kernel/ldt.c 2005-10-29 05:50:22.000000000 +0200 +++ linux-2.6.14/arch/i386/kernel/ldt.c 2005-10-29 05:50:30.000000000 +0200 @@ -259,5 +259,9 @@ asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount) { - return __modify_ldt(current->mm, func, ptr, bytecount); + int ret = __modify_ldt(current->mm, func, ptr, bytecount); + /* 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; } Index: linux-2.6.14/mm/mprotect.c =================================================================== --- linux-2.6.14.orig/mm/mprotect.c 2005-10-29 05:50:00.000000000 +0200 +++ linux-2.6.14/mm/mprotect.c 2005-10-29 05:50:30.000000000 +0200 @@ -285,5 +285,9 @@ asmlinkage long sys_mprotect(unsigned long start, size_t len, unsigned long prot) { - return(do_mprotect(current->mm, start, len, prot)); + long ret = do_mprotect(current->mm, start, len, prot); + /* 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; }