From: Jeff Dike Spotted by Al Viro, there was some bogosity in the UML/x86_64 modify_ltd. Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton --- 25-akpm/arch/um/sys-x86_64/syscalls.c | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-) diff -puN arch/um/sys-x86_64/syscalls.c~uml-remove-mm_indirect-reference-in-modify_ldt arch/um/sys-x86_64/syscalls.c --- 25/arch/um/sys-x86_64/syscalls.c~uml-remove-mm_indirect-reference-in-modify_ldt 2005-03-07 22:16:22.000000000 -0800 +++ 25-akpm/arch/um/sys-x86_64/syscalls.c 2005-03-07 22:16:22.000000000 -0800 @@ -36,15 +36,11 @@ long sys_modify_ldt_tt(int func, void *p #endif #ifdef CONFIG_MODE_SKAS -extern int userspace_pid; - -#ifndef __NR_mm_indirect -#define __NR_mm_indirect 241 -#endif +extern int userspace_pid[]; long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) { - unsigned long args[6]; + struct ptrace_ldt ldt; void *buf; int res, n; @@ -66,12 +62,11 @@ long sys_modify_ldt_skas(int func, void goto out; } - args[0] = func; - args[1] = (unsigned long) buf; - args[2] = bytecount; - res = syscall(__NR_mm_indirect, ¤t->mm->context.u, - __NR_modify_ldt, args); - + ldt = ((struct ptrace_ldt) { .func = func, + .ptr = buf, + .bytecount = bytecount }); +#warning Need to look up userspace_pid by cpu + res = ptrace(PTRACE_LDT, userspace_pid[0], 0, (unsigned long) &ldt); if(res < 0) goto out; _