diff options
author | Richard Weinberger <richard@nod.at> | 2014-03-05 09:24:06 -0500 |
---|---|---|
committer | Richard Weinberger <richard@sigma-star.at> | 2014-08-06 07:04:08 -0400 |
commit | 8bc77aa45e8383e760f1a7edd12ed4d077a068d8 (patch) | |
tree | 604309e9b01b7ee097482cba3a037041f938f6c8 /arch/hexagon | |
parent | 4a03ac362ebd115c0e42863b288648f5b536c95f (diff) |
hexagon: Use sigsp()
Use sigsp() instead of the open coded variant.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/hexagon')
-rw-r--r-- | arch/hexagon/kernel/signal.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c index 6525358630d4..eadd70e47e7e 100644 --- a/arch/hexagon/kernel/signal.c +++ b/arch/hexagon/kernel/signal.c | |||
@@ -36,18 +36,10 @@ struct rt_sigframe { | |||
36 | struct ucontext uc; | 36 | struct ucontext uc; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | 39 | static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, |
40 | size_t frame_size) | 40 | size_t frame_size) |
41 | { | 41 | { |
42 | unsigned long sp = regs->r29; | 42 | unsigned long sp = sigsp(regs->r29, ksig); |
43 | |||
44 | /* check if we would overflow the alt stack */ | ||
45 | if (on_sig_stack(sp) && !likely(on_sig_stack(sp - frame_size))) | ||
46 | return (void __user __force *)-1UL; | ||
47 | |||
48 | /* Switch to signal stack if appropriate */ | ||
49 | if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0)) | ||
50 | sp = current->sas_ss_sp + current->sas_ss_size; | ||
51 | 43 | ||
52 | return (void __user *)((sp - frame_size) & ~(sizeof(long long) - 1)); | 44 | return (void __user *)((sp - frame_size) & ~(sizeof(long long) - 1)); |
53 | } | 45 | } |
@@ -119,7 +111,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, | |||
119 | struct rt_sigframe __user *frame; | 111 | struct rt_sigframe __user *frame; |
120 | struct hexagon_vdso *vdso = current->mm->context.vdso; | 112 | struct hexagon_vdso *vdso = current->mm->context.vdso; |
121 | 113 | ||
122 | frame = get_sigframe(&ksig->ka, regs, sizeof(struct rt_sigframe)); | 114 | frame = get_sigframe(ksig, regs, sizeof(struct rt_sigframe)); |
123 | 115 | ||
124 | if (!access_ok(VERIFY_WRITE, frame, sizeof(struct rt_sigframe))) | 116 | if (!access_ok(VERIFY_WRITE, frame, sizeof(struct rt_sigframe))) |
125 | return -EFAULT; | 117 | return -EFAULT; |