Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- clean-linux-2.6.11-paolo/arch/i386/kernel/ldt.c | 6 +++++- clean-linux-2.6.11-paolo/mm/mprotect.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff -puN arch/i386/kernel/ldt.c~skas-prevent-tail-call-cont arch/i386/kernel/ldt.c --- clean-linux-2.6.11/arch/i386/kernel/ldt.c~skas-prevent-tail-call-cont 2005-07-11 11:35:56.000000000 +0200 +++ clean-linux-2.6.11-paolo/arch/i386/kernel/ldt.c 2005-07-11 11:35:56.000000000 +0200 @@ -262,5 +262,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; } diff -puN mm/mprotect.c~skas-prevent-tail-call-cont mm/mprotect.c --- clean-linux-2.6.11/mm/mprotect.c~skas-prevent-tail-call-cont 2005-07-11 11:35:56.000000000 +0200 +++ clean-linux-2.6.11-paolo/mm/mprotect.c 2005-07-11 11:35:56.000000000 +0200 @@ -324,5 +324,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; } _