diff options
Diffstat (limited to 'arch/um/sys-x86_64/syscalls.c')
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 3259a4db4534..6acee5c4ada6 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -29,81 +29,6 @@ asmlinkage long sys_uname64(struct new_utsname __user * name) | |||
29 | } | 29 | } |
30 | 30 | ||
31 | #ifdef CONFIG_MODE_TT | 31 | #ifdef CONFIG_MODE_TT |
32 | extern int modify_ldt(int func, void *ptr, unsigned long bytecount); | ||
33 | |||
34 | long sys_modify_ldt_tt(int func, void *ptr, unsigned long bytecount) | ||
35 | { | ||
36 | /* XXX This should check VERIFY_WRITE depending on func, check this | ||
37 | * in i386 as well. | ||
38 | */ | ||
39 | if (!access_ok(VERIFY_READ, ptr, bytecount)) | ||
40 | return -EFAULT; | ||
41 | return(modify_ldt(func, ptr, bytecount)); | ||
42 | } | ||
43 | #endif | ||
44 | |||
45 | #ifdef CONFIG_MODE_SKAS | ||
46 | extern int userspace_pid[]; | ||
47 | |||
48 | #include "skas_ptrace.h" | ||
49 | |||
50 | long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) | ||
51 | { | ||
52 | struct ptrace_ldt ldt; | ||
53 | void *buf; | ||
54 | int res, n; | ||
55 | |||
56 | buf = kmalloc(bytecount, GFP_KERNEL); | ||
57 | if(buf == NULL) | ||
58 | return(-ENOMEM); | ||
59 | |||
60 | res = 0; | ||
61 | |||
62 | switch(func){ | ||
63 | case 1: | ||
64 | case 0x11: | ||
65 | res = copy_from_user(buf, ptr, bytecount); | ||
66 | break; | ||
67 | } | ||
68 | |||
69 | if(res != 0){ | ||
70 | res = -EFAULT; | ||
71 | goto out; | ||
72 | } | ||
73 | |||
74 | ldt = ((struct ptrace_ldt) { .func = func, | ||
75 | .ptr = buf, | ||
76 | .bytecount = bytecount }); | ||
77 | #warning Need to look up userspace_pid by cpu | ||
78 | res = ptrace(PTRACE_LDT, userspace_pid[0], 0, (unsigned long) &ldt); | ||
79 | if(res < 0) | ||
80 | goto out; | ||
81 | |||
82 | switch(func){ | ||
83 | case 0: | ||
84 | case 2: | ||
85 | n = res; | ||
86 | res = copy_to_user(ptr, buf, n); | ||
87 | if(res != 0) | ||
88 | res = -EFAULT; | ||
89 | else | ||
90 | res = n; | ||
91 | break; | ||
92 | } | ||
93 | |||
94 | out: | ||
95 | kfree(buf); | ||
96 | return(res); | ||
97 | } | ||
98 | #endif | ||
99 | |||
100 | long sys_modify_ldt(int func, void *ptr, unsigned long bytecount) | ||
101 | { | ||
102 | return(CHOOSE_MODE_PROC(sys_modify_ldt_tt, sys_modify_ldt_skas, func, | ||
103 | ptr, bytecount)); | ||
104 | } | ||
105 | |||
106 | #ifdef CONFIG_MODE_TT | ||
107 | extern long arch_prctl(int code, unsigned long addr); | 32 | extern long arch_prctl(int code, unsigned long addr); |
108 | 33 | ||
109 | static long arch_prctl_tt(int code, unsigned long addr) | 34 | static long arch_prctl_tt(int code, unsigned long addr) |