Skip to content

Commit

Permalink
[PATCH] uml: fix signal frame copy_user
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Sep 5, 2005
1 parent 3b52166 commit e54a5df
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion arch/um/sys-i386/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext *from,
int err;

to_fp = to->fpstate;
from_fp = from->fpstate;
sigs = to->oldmask;
err = copy_from_user(to, from, sizeof(*to));
from_fp = to->fpstate;
to->oldmask = sigs;
to->fpstate = to_fp;
if(to_fp != NULL)
Expand Down
41 changes: 24 additions & 17 deletions arch/um/sys-x86_64/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 fpsize)
{
struct _fpstate *to_fp, *from_fp;
unsigned long sigs;
int err;

to_fp = to->fpstate;
from_fp = from->fpstate;
sigs = to->oldmask;
err = copy_from_user(to, from, sizeof(*to));
to->oldmask = sigs;
return(err);
struct _fpstate *to_fp, *from_fp;
unsigned long sigs;
int err;

to_fp = to->fpstate;
sigs = to->oldmask;
err = copy_from_user(to, from, sizeof(*to));
from_fp = to->fpstate;
to->fpstate = to_fp;
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,
struct sigcontext *from, int fpsize)
{
struct _fpstate *to_fp, *from_fp;
int err;

to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
from_fp = from->fpstate;
err = copy_to_user(to, from, sizeof(*to));
return(err);
struct _fpstate *to_fp, *from_fp;
int err;

to_fp = (fp ? fp : (struct _fpstate *) (to + 1));
from_fp = from->fpstate;
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);
}

#endif
Expand Down

0 comments on commit e54a5df

Please sign in to comment.