Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad30f3ff authored by John David Anglin's avatar John David Anglin Committed by Helge Deller
Browse files

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: default avatarJohn David Anglin <dave.anglin@bell.net>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 34360f08
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -190,8 +190,10 @@ get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
	DBG(1,"get_sigframe: ka = %#lx, sp = %#lx, frame_size = %#lx\n",
			(unsigned long)ka, sp, frame_size);
	
	/* Align alternate stack and reserve 64 bytes for the signal
	   handler's frame marker.  */
	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp))
		sp = current->sas_ss_sp; /* Stacks grow up! */
		sp = (current->sas_ss_sp + 0x7f) & ~0x3f; /* Stacks grow up! */

	DBG(1,"get_sigframe: Returning sp = %#lx\n", (unsigned long)sp);
	return (void __user *) sp; /* Stacks grow up.  Fun. */