Commit 0ec7c9f8 authored by Jeff Dike's avatar Jeff Dike Committed by Adrian Bunk

uml: fix signal frame alignment

Use the same signal frame alignment calculations as the underlying
architecture.  x86_64 appeared to do this, but the "- 8" was really
subtracting 8 * sizeof(struct rt_sigframe) rather than 8 bytes.

UML/i386 might have been OK, but I changed the calculation to match
i386 just to be sure.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 419c9c25
...@@ -209,7 +209,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig, ...@@ -209,7 +209,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
void *restorer; void *restorer;
int err = 0; int err = 0;
stack_top &= -8UL; stack_top = ((stack_top + 4) & -16UL) - 4;
frame = (struct sigframe *) stack_top - 1; frame = (struct sigframe *) stack_top - 1;
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return 1; return 1;
......
...@@ -174,8 +174,9 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, ...@@ -174,8 +174,9 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
struct task_struct *me = current; struct task_struct *me = current;
frame = (struct rt_sigframe __user *) frame = (struct rt_sigframe __user *)
round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; round_down(stack_top - sizeof(struct rt_sigframe), 16);
frame = (struct rt_sigframe *) ((unsigned long) frame - 128); /* Subtract 128 for a red zone and 8 for proper alignment */
frame = (struct rt_sigframe *) ((unsigned long) frame - 128 - 8);
if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate)))
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment