diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2011-08-18 15:00:29 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2011-11-02 09:14:41 -0400 |
commit | 3c916fec12ab614aca5cf6ec09ae3adc6b911193 (patch) | |
tree | 60d3d645482cfc080563a102fb7fbb84fd7ac4b8 | |
parent | 78722a445bb253fa6bcbe9d6589f27db78056af6 (diff) |
um: don't rely on sc.fpstate not having been reassigned prior to rt_sigreturn()
native rt_sigreturn() doesn't...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r-- | arch/um/sys-x86_64/signal.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index 581b64d86a6c..ccfa5544e92c 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c | |||
@@ -44,10 +44,10 @@ void copy_sc(struct uml_pt_regs *regs, void *from) | |||
44 | } | 44 | } |
45 | 45 | ||
46 | static int copy_sc_from_user(struct pt_regs *regs, | 46 | static int copy_sc_from_user(struct pt_regs *regs, |
47 | struct sigcontext __user *from, | 47 | struct sigcontext __user *from) |
48 | struct _fpstate __user *fpp) | ||
49 | { | 48 | { |
50 | struct user_i387_struct fp; | 49 | struct user_i387_struct fp; |
50 | void __user *buf; | ||
51 | int err = 0; | 51 | int err = 0; |
52 | 52 | ||
53 | #define GETREG(regs, regno, sc, regname) \ | 53 | #define GETREG(regs, regno, sc, regname) \ |
@@ -78,7 +78,11 @@ static int copy_sc_from_user(struct pt_regs *regs, | |||
78 | 78 | ||
79 | #undef GETREG | 79 | #undef GETREG |
80 | 80 | ||
81 | err = copy_from_user(&fp, fpp, sizeof(struct user_i387_struct)); | 81 | err = __get_user(buf, &from->fpstate); |
82 | if (err) | ||
83 | return 1; | ||
84 | |||
85 | err = copy_from_user(&fp, buf, sizeof(struct user_i387_struct)); | ||
82 | if (err) | 86 | if (err) |
83 | return 1; | 87 | return 1; |
84 | 88 | ||
@@ -272,8 +276,7 @@ long sys_rt_sigreturn(struct pt_regs *regs) | |||
272 | sigdelsetmask(&set, ~_BLOCKABLE); | 276 | sigdelsetmask(&set, ~_BLOCKABLE); |
273 | set_current_blocked(&set); | 277 | set_current_blocked(&set); |
274 | 278 | ||
275 | if (copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext, | 279 | if (copy_sc_from_user(¤t->thread.regs, &uc->uc_mcontext)) |
276 | &frame->fpstate)) | ||
277 | goto segfault; | 280 | goto segfault; |
278 | 281 | ||
279 | /* Avoid ERESTART handling */ | 282 | /* Avoid ERESTART handling */ |