diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/sys-i386/signal.c | 3 | ||||
-rw-r--r-- | arch/um/sys-x86_64/signal.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 0709fc6670c2..3f6acd667717 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c | |||
@@ -219,7 +219,8 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig, | |||
219 | unsigned long save_sp = PT_REGS_SP(regs); | 219 | unsigned long save_sp = PT_REGS_SP(regs); |
220 | int err = 0; | 220 | int err = 0; |
221 | 221 | ||
222 | stack_top &= -8UL; | 222 | /* This is the same calculation as i386 - ((sp + 4) & 15) == 0 */ |
223 | stack_top = ((stack_top + 4) & -16UL) - 4; | ||
223 | frame = (struct sigframe __user *) stack_top - 1; | 224 | frame = (struct sigframe __user *) stack_top - 1; |
224 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 225 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
225 | return 1; | 226 | return 1; |
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index 9edf114faf79..af2f017617b4 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c | |||
@@ -191,8 +191,9 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
191 | struct task_struct *me = current; | 191 | struct task_struct *me = current; |
192 | 192 | ||
193 | frame = (struct rt_sigframe __user *) | 193 | frame = (struct rt_sigframe __user *) |
194 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; | 194 | round_down(stack_top - sizeof(struct rt_sigframe), 16); |
195 | frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128); | 195 | /* Subtract 128 for a red zone and 8 for proper alignment */ |
196 | frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128 - 8); | ||
196 | 197 | ||
197 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) | 198 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) |
198 | goto out; | 199 | goto out; |