aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
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
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')
-rw-r--r--arch/um/sys-i386/signal.c2
-rw-r--r--arch/um/sys-x86_64/signal.c41
2 files changed, 25 insertions, 18 deletions
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 4efc69a039d7..16bc19928b3c 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -122,9 +122,9 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
122 int err; 122 int err;
123 123
124 to_fp = to->fpstate; 124 to_fp = to->fpstate;
125 from_fp = from->fpstate;
126 sigs = to->oldmask; 125 sigs = to->oldmask;
127 err = copy_from_user(to, from, sizeof(*to)); 126 err = copy_from_user(to, from, sizeof(*to));
127 from_fp = to->fpstate;
128 to->oldmask = sigs; 128 to->oldmask = sigs;
129 to->fpstate = to_fp; 129 to->fpstate = to_fp;
130 if(to_fp != NULL) 130 if(to_fp != NULL)
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