aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64
diff options
context:
space:
mode:
authorAl Viro <viro@parcelfarce.linux.theplanet.co.uk>2005-09-03 18:57:27 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:21 -0400
commite54a5dfb960053437f464a7ce372a8acc293fdcb (patch)
tree01432a58e039716ab0a02347a027e84da10c370f /arch/um/sys-x86_64
parent3b52166cf72f0826c6d8fa0541c7d4ae39c5a146 (diff)
[PATCH] uml: fix signal frame copy_user
The copy_user stuff in the signal frame code was broke. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/sys-x86_64')
-rw-r--r--arch/um/sys-x86_64/signal.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 8fdaed06c10d..fe1d065332b1 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -104,28 +104,35 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
104int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, 104int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
105 int fpsize) 105 int fpsize)
106{ 106{
107 struct _fpstate *to_fp, *from_fp; 107 struct _fpstate *to_fp, *from_fp;
108 unsigned long sigs; 108 unsigned long sigs;
109 int err; 109 int err;
110 110
111 to_fp = to->fpstate; 111 to_fp = to->fpstate;
112 from_fp = from->fpstate; 112 sigs = to->oldmask;
113 sigs = to->oldmask; 113 err = copy_from_user(to, from, sizeof(*to));
114 err = copy_from_user(to, from, sizeof(*to)); 114 from_fp = to->fpstate;
115 to->oldmask = sigs; 115 to->fpstate = to_fp;
116 return(err); 116 to->oldmask = sigs;
117 if(to_fp != NULL)
118 err |= copy_from_user(to_fp, from_fp, fpsize);
119 return(err);
117} 120}
118 121
119int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, 122int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
120 struct sigcontext *from, int fpsize) 123 struct sigcontext *from, int fpsize)
121{ 124{
122 struct _fpstate *to_fp, *from_fp; 125 struct _fpstate *to_fp, *from_fp;
123 int err; 126 int err;
124 127
125 to_fp = (fp ? fp : (struct _fpstate *) (to + 1)); 128 to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
126 from_fp = from->fpstate; 129 from_fp = from->fpstate;
127 err = copy_to_user(to, from, sizeof(*to)); 130 err = copy_to_user(to, from, sizeof(*to));
128 return(err); 131 if(from_fp != NULL){
132 err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
133 err |= copy_to_user(to_fp, from_fp, fpsize);
134 }
135 return(err);
129} 136}
130 137
131#endif 138#endif