diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-02-14 20:37:44 +0100 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2007-02-14 20:37:44 +0100 |
commit | 0ec7c9f826a86a2a24101192e6f5f804ed8d7021 (patch) | |
tree | cc871d4e4af9e3a673c0d5fa4a942112fc3d1966 /arch | |
parent | 419c9c25b8a75bd88d6014498a81610b2e658b08 (diff) |
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: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/sys-i386/signal.c | 2 | ||||
-rw-r--r-- | arch/um/sys-x86_64/signal.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 7cd1a82dc8c..a4a174c06e9 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c @@ -209,7 +209,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig, void *restorer; int err = 0; - stack_top &= -8UL; + stack_top = ((stack_top + 4) & -16UL) - 4; frame = (struct sigframe *) stack_top - 1; if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) return 1; diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index fe1d065332b..84940ab1c45 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c @@ -174,8 +174,9 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, struct task_struct *me = current; frame = (struct rt_sigframe __user *) - round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; - frame = (struct rt_sigframe *) ((unsigned long) frame - 128); + round_down(stack_top - sizeof(struct rt_sigframe), 16); + /* 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))) goto out; |