skas-prevent-tail-call-cont Signed-off-by: Paolo 'Blaisorblade' Giarrusso Index: linux-2.6.18/arch/i386/kernel/ldt.c =================================================================== --- linux-2.6.18.orig/arch/i386/kernel/ldt.c +++ linux-2.6.18/arch/i386/kernel/ldt.c @@ -259,5 +259,9 @@ int __modify_ldt(struct mm_struct * mm, 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.18/mm/mprotect.c =================================================================== --- linux-2.6.18.orig/mm/mprotect.c +++ linux-2.6.18/mm/mprotect.c @@ -312,5 +312,9 @@ out: 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; }