Commit e54a5dfb authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] uml: fix signal frame copy_user

The copy_user stuff in the signal frame code was broke.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3b52166c
...@@ -122,9 +122,9 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, ...@@ -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)
......
...@@ -109,10 +109,13 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from, ...@@ -109,10 +109,13 @@ 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->fpstate = to_fp;
to->oldmask = sigs; to->oldmask = sigs;
if(to_fp != NULL)
err |= copy_from_user(to_fp, from_fp, fpsize);
return(err); return(err);
} }
...@@ -125,6 +128,10 @@ int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp, ...@@ -125,6 +128,10 @@ int copy_sc_to_user_tt(struct sigcontext *to, struct _fpstate *fp,
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));
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); return(err);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment