aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/sys-x86_64/signal.c')
-rw-r--r--arch/um/sys-x86_64/signal.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index a4c46a8af008..9edf114faf79 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -21,7 +21,7 @@
21#include "skas.h" 21#include "skas.h"
22 22
23static int copy_sc_from_user_skas(struct pt_regs *regs, 23static int copy_sc_from_user_skas(struct pt_regs *regs,
24 struct sigcontext *from) 24 struct sigcontext __user *from)
25{ 25{
26 int err = 0; 26 int err = 0;
27 27
@@ -54,7 +54,8 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
54 return(err); 54 return(err);
55} 55}
56 56
57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, 57int copy_sc_to_user_skas(struct sigcontext __user *to,
58 struct _fpstate __user *to_fp,
58 struct pt_regs *regs, unsigned long mask, 59 struct pt_regs *regs, unsigned long mask,
59 unsigned long sp) 60 unsigned long sp)
60{ 61{
@@ -106,10 +107,11 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
106#endif 107#endif
107 108
108#ifdef CONFIG_MODE_TT 109#ifdef CONFIG_MODE_TT
109int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 110int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
110 int fpsize) 111 int fpsize)
111{ 112{
112 struct _fpstate *to_fp, *from_fp; 113 struct _fpstate *to_fp;
114 struct _fpstate __user *from_fp;
113 unsigned long sigs; 115 unsigned long sigs;
114 int err; 116 int err;
115 117
@@ -124,13 +126,14 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
124 return(err); 126 return(err);
125} 127}
126 128
127int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 129int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp,
128 struct sigcontext *from, int fpsize, unsigned long sp) 130 struct sigcontext *from, int fpsize, unsigned long sp)
129{ 131{
130 struct _fpstate *to_fp, *from_fp; 132 struct _fpstate __user *to_fp;
133 struct _fpstate *from_fp;
131 int err; 134 int err;
132 135
133 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 136 to_fp = (fp ? fp : (struct _fpstate __user *) (to + 1));
134 from_fp = from->fpstate; 137 from_fp = from->fpstate;
135 err = copy_to_user(to, from, sizeof(*to)); 138 err = copy_to_user(to, from, sizeof(*to));
136 /* The SP in the sigcontext is the updated one for the signal 139 /* The SP in the sigcontext is the updated one for the signal
@@ -158,7 +161,8 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
158 return(ret); 161 return(ret);
159} 162}
160 163
161static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp, 164static int copy_sc_to_user(struct sigcontext __user *to,
165 struct _fpstate __user *fp,
162 struct pt_regs *from, unsigned long mask, 166 struct pt_regs *from, unsigned long mask,
163 unsigned long sp) 167 unsigned long sp)
164{ 168{
@@ -169,7 +173,7 @@ static int copy_sc_to_user(struct sigcontext *to, struct _fpstate *fp,
169 173
170struct rt_sigframe 174struct rt_sigframe
171{ 175{
172 char *pretcode; 176 char __user *pretcode;
173 struct ucontext uc; 177 struct ucontext uc;
174 struct siginfo info; 178 struct siginfo info;
175}; 179};
@@ -188,7 +192,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
188 192
189 frame = (struct rt_sigframe __user *) 193 frame = (struct rt_sigframe __user *)
190 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 194 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
191 frame = (struct rt_sigframe *) ((unsigned long) frame - 128); 195 frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128);
192 196
193 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 197 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
194 goto out; 198 goto out;