aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/sys-x86_64/signal.c')
-rw-r--r--arch/um/sys-x86_64/signal.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 5bc5a0d796e5..73a7926f7370 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -57,7 +57,7 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp, 57int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
58 struct pt_regs *regs, unsigned long mask) 58 struct pt_regs *regs, unsigned long mask)
59{ 59{
60 unsigned long eflags; 60 struct faultinfo * fi = &current->thread.arch.faultinfo;
61 int err = 0; 61 int err = 0;
62 62
63 err |= __put_user(0, &to->gs); 63 err |= __put_user(0, &to->gs);
@@ -84,14 +84,16 @@ int copy_sc_to_user_skas(struct sigcontext *to, struct _fpstate *to_fp,
84 err |= PUTREG(regs, R14, to, r14); 84 err |= PUTREG(regs, R14, to, r14);
85 err |= PUTREG(regs, R15, to, r15); 85 err |= PUTREG(regs, R15, to, r15);
86 err |= PUTREG(regs, CS, to, cs); /* XXX x86_64 doesn't do this */ 86 err |= PUTREG(regs, CS, to, cs); /* XXX x86_64 doesn't do this */
87 err |= __put_user(current->thread.err, &to->err); 87
88 err |= __put_user(current->thread.trap_no, &to->trapno); 88 err |= __put_user(fi->cr2, &to->cr2);
89 err |= __put_user(fi->error_code, &to->err);
90 err |= __put_user(fi->trap_no, &to->trapno);
91
89 err |= PUTREG(regs, RIP, to, rip); 92 err |= PUTREG(regs, RIP, to, rip);
90 err |= PUTREG(regs, EFLAGS, to, eflags); 93 err |= PUTREG(regs, EFLAGS, to, eflags);
91#undef PUTREG 94#undef PUTREG
92 95
93 err |= __put_user(mask, &to->oldmask); 96 err |= __put_user(mask, &to->oldmask);
94 err |= __put_user(current->thread.cr2, &to->cr2);
95 97
96 return(err); 98 return(err);
97} 99}
@@ -166,7 +168,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
166 168
167 frame = (struct rt_sigframe __user *) 169 frame = (struct rt_sigframe __user *)
168 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; 170 round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8;
169 frame -= 128; 171 ((unsigned char *) frame) -= 128;
170 172
171 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) 173 if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
172 goto out; 174 goto out;