diff options
author | John David Anglin <dave.anglin@bell.net> | 2012-11-25 16:39:00 -0500 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2013-01-07 17:06:27 -0500 |
commit | ad30f3ff3deb4037f2beea15812d01d795f8b3cc (patch) | |
tree | 20dbd553fb9244141d242303acd4679a9c67d1b4 | |
parent | 34360f080cb5848990576e1465d2d01a3c261762 (diff) |
parisc: sigaltstack doesn't round ss.ss_sp as required
On 24-Nov-12, at 10:05 AM, John David Anglin wrote:
> In trying to build the debian libsigsegv2 package, I found that sigaltstack
> doesn't round ss.ss_sp. The tests intentionally pass an unaligned pointer.
> This results in the two stack overflow tests failing.
The attached patch fixes this issue.
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | arch/parisc/kernel/signal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 537996955998..fd051705a407 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c | |||
@@ -190,8 +190,10 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) | |||
190 | DBG(1,"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx\n", | 190 | DBG(1,"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx\n", |
191 | (unsigned long)ka, sp, frame_size); | 191 | (unsigned long)ka, sp, frame_size); |
192 | 192 | ||
193 | /* Align alternate stack and reserve 64 bytes for the signal | ||
194 | handler's frame marker. */ | ||
193 | if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) | 195 | if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp)) |
194 | sp = current->sas_ss_sp; /* Stacks grow up! */ | 196 | sp = (current->sas_ss_sp + 0x7f) & ~0x3f; /* Stacks grow up! */ |
195 | 197 | ||
196 | DBG(1,"get_sigframe: Returning sp = %#lx\n", (unsigned long)sp); | 198 | DBG(1,"get_sigframe: Returning sp = %#lx\n", (unsigned long)sp); |
197 | return (void __user *) sp; /* Stacks grow up. Fun. */ | 199 | return (void __user *) sp; /* Stacks grow up. Fun. */ |