[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>
This commit is contained in:
parent
3b52166cf7
commit
e54a5dfb96
2 changed files with 23 additions and 16 deletions
|
@ -122,9 +122,9 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
to_fp = to->fpstate;
|
to_fp = to->fpstate;
|
||||||
from_fp = from->fpstate;
|
|
||||||
sigs = to->oldmask;
|
sigs = to->oldmask;
|
||||||
err = copy_from_user(to, from, sizeof(*to));
|
err = copy_from_user(to, from, sizeof(*to));
|
||||||
|
from_fp = to->fpstate;
|
||||||
to->oldmask = sigs;
|
to->oldmask = sigs;
|
||||||
to->fpstate = to_fp;
|
to->fpstate = to_fp;
|
||||||
if(to_fp != NULL)
|
if(to_fp != NULL)
|
||||||
|
|
|
@ -104,28 +104,35 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
|
||||||
int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
|
int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
|
||||||
int fpsize)
|
int fpsize)
|
||||||
{
|
{
|
||||||
struct _fpstate *to_fp, *from_fp;
|
struct _fpstate *to_fp, *from_fp;
|
||||||
unsigned long sigs;
|
unsigned long sigs;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
to_fp = to->fpstate;
|
to_fp = to->fpstate;
|
||||||
from_fp = from->fpstate;
|
sigs = to->oldmask;
|
||||||
sigs = to->oldmask;
|
err = copy_from_user(to, from, sizeof(*to));
|
||||||
err = copy_from_user(to, from, sizeof(*to));
|
from_fp = to->fpstate;
|
||||||
to->oldmask = sigs;
|
to->fpstate = to_fp;
|
||||||
return(err);
|
to->oldmask = sigs;
|
||||||
|
if(to_fp != NULL)
|
||||||
|
err |= copy_from_user(to_fp, from_fp, fpsize);
|
||||||
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
|
int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
|
||||||
struct sigcontext *from, int fpsize)
|
struct sigcontext *from, int fpsize)
|
||||||
{
|
{
|
||||||
struct _fpstate *to_fp, *from_fp;
|
struct _fpstate *to_fp, *from_fp;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
|
to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
|
||||||
from_fp = from->fpstate;
|
from_fp = from->fpstate;
|
||||||
err = copy_to_user(to, from, sizeof(*to));
|
err = copy_to_user(to, from, sizeof(*to));
|
||||||
return(err);
|
if(from_fp != NULL){
|
||||||
|
err |= copy_to_user(&to->fpstate, &to_fp, sizeof(to->fpstate));
|
||||||
|
err |= copy_to_user(to_fp, from_fp, fpsize);
|
||||||
|
}
|
||||||
|
return(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue