From patchwork Sun Nov 25 21:39:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John David Anglin X-Patchwork-Id: 1799651 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 27D08DF264 for ; Sun, 25 Nov 2012 21:39:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753461Ab2KYVjU (ORCPT ); Sun, 25 Nov 2012 16:39:20 -0500 Received: from blu0-omc4-s8.blu0.hotmail.com ([65.55.111.147]:48338 "EHLO blu0-omc4-s8.blu0.hotmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753456Ab2KYVjT (ORCPT ); Sun, 25 Nov 2012 16:39:19 -0500 Received: from BLU0-SMTP91 ([65.55.111.135]) by blu0-omc4-s8.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 25 Nov 2012 13:39:18 -0800 X-Originating-IP: [69.158.171.42] X-EIP: [4KtKrNq5vKyCX0t6yeui8eRN7coShGGR] X-Originating-Email: [dave.anglin@bell.net] Message-ID: Received: from [192.168.2.10] ([69.158.171.42]) by BLU0-SMTP91.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 25 Nov 2012 13:39:17 -0800 CC: Helge Deller , Parisc List , "James E.J. Bottomley" From: John David Anglin To: John David Anglin In-Reply-To: MIME-Version: 1.0 (Apple Message framework v936) Subject: [PATCH] parisc: sigaltstack doesn't round ss.ss_sp as required Date: Sun, 25 Nov 2012 16:39:00 -0500 References: X-Mailer: Apple Mail (2.936) X-OriginalArrivalTime: 25 Nov 2012 21:39:17.0395 (UTC) FILETIME=[521DB630:01CDCB55] Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org 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 --- John David Anglin dave.anglin@bell.net diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 594459b..324644d 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c @@ -188,8 +188,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. */