* [uml-devel] [PATCH 13/16] UML - Remove mm_indirect reference in modify_ldt
@ 2005-03-07 20:38 Jeff Dike
0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-03-07 20:38 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, user-mode-linux-devel
Spotted by Al Viro, there was some bogosity in the UML/x86_64 modify_ltd.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: linux-2.6.11/arch/um/sys-x86_64/syscalls.c
===================================================================
--- linux-2.6.11.orig/arch/um/sys-x86_64/syscalls.c 2005-03-05 12:07:31.000000000 -0500
+++ linux-2.6.11/arch/um/sys-x86_64/syscalls.c 2005-03-05 12:21:27.000000000 -0500
@@ -36,15 +36,11 @@
#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 @@
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;
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-07 18:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-07 20:38 [uml-devel] [PATCH 13/16] UML - Remove mm_indirect reference in modify_ldt Jeff Dike
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox