From patchwork Tue Jun 20 16:24:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 9799947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC549600F6 for ; Tue, 20 Jun 2017 16:25:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C79331FF22 for ; Tue, 20 Jun 2017 16:25:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC24026256; Tue, 20 Jun 2017 16:25:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 22F5E1FF22 for ; Tue, 20 Jun 2017 16:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=p/ntlw0zh8aytXfq9Zbxyu6ZA3RpFcQCtovWvsVx3xM=; b=s2r9S2Tg3lTMlPZ8aOsVh7wXXz 5CPzZJXnlZ8afxmwTFUJB05gbLzNABuIn6iogqped9UCkYJfEtshcUQdWayQ01aMGgiR4toP8CdKq ijpHA+8viHtK8co+42fG/kA+f7fVimjh7PvlOXyH0NQmNvROoRpRpQ54XwkmzGsme6i1ZdSEq3jJb g0zpf/eqEyDAw3N9WJr9MLQWCCqMvR70Z5xszN0dhiM+NaF8+2V9Zsu4yXT0JA7Lrb43akS/VmhAg Y3Bo/GfmwEmH/jtoJU7DCWEs3HsO0ezIFcZanmMbO2r73o6qbR0ohRXyA513BXtvCA9tQwDU0Xm7C BxeJNuTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dNLxw-0001ZF-D6; Tue, 20 Jun 2017 16:25:20 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dNLxo-0008Qp-Bi for linux-arm-kernel@lists.infradead.org; Tue, 20 Jun 2017 16:25:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 104562B; Tue, 20 Jun 2017 09:24:52 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3D5573F41F; Tue, 20 Jun 2017 09:24:51 -0700 (PDT) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] fixup! arm64: signal: Allow expansion of the signal frame Date: Tue, 20 Jun 2017 17:24:36 +0100 Message-Id: <1497975876-7055-1-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <20170619110346.GB3024@e104818-lin.cambridge.arm.com> References: <20170619110346.GB3024@e104818-lin.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170620_092512_786292_E1508837 X-CRM114-Status: GOOD ( 11.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Catalin Marinas , Will Deacon MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Convert extra_context.data to a u64 for better ABI independence. data is renamed to "datap" to give a stronger clue that it is a pointer. The binary interface is unchanged. Signed-off-by: Dave Martin --- I've build-tested this fixup only. The only change here is to replace the name "data" with "datap" in appropriate places and change void __user * to u64 appropriately, with casts in the two places where this value enters and exits the kernel. arch/arm64/include/uapi/asm/sigcontext.h | 6 +++--- arch/arm64/kernel/signal.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h index 303a48c..f0a76b9 100644 --- a/arch/arm64/include/uapi/asm/sigcontext.h +++ b/arch/arm64/include/uapi/asm/sigcontext.h @@ -98,7 +98,7 @@ struct esr_context { * 3) If extra_context is present, it must be followed immediately in * sigcontext.__reserved[] by the terminating null _aarch64_ctx. * - * 4) The extra space to which data points must start at the first + * 4) The extra space to which datap points must start at the first * 16-byte aligned address immediately after the terminating null * _aarch64_ctx that follows the extra_context structure in * __reserved[]. The extra space may overrun the end of __reserved[], @@ -111,8 +111,8 @@ struct esr_context { struct extra_context { struct _aarch64_ctx head; - void __user *data; /* 16-byte aligned pointer to extra space */ - __u32 size; /* size in bytes of the extra space */ + __u64 datap; /* 16-byte aligned pointer to extra space cast to __u64 */ + __u32 size; /* size in bytes of the extra space */ __u32 __reserved[3]; }; diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index 3602fb7..cb0d008 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -244,7 +244,7 @@ static int parse_user_sigframe(struct user_ctxs *user, u32 magic, size; char const __user *userp; struct extra_context const __user *extra; - void __user *extra_data; + u64 extra_datap; u32 extra_size; struct _aarch64_ctx const __user *end; u32 end_magic, end_size; @@ -297,7 +297,7 @@ static int parse_user_sigframe(struct user_ctxs *user, extra = (struct extra_context const __user *)userp; userp += size; - __get_user_error(extra_data, &extra->data, err); + __get_user_error(extra_datap, &extra->datap, err); __get_user_error(extra_size, &extra->size, err); if (err) return err; @@ -321,14 +321,14 @@ static int parse_user_sigframe(struct user_ctxs *user, /* Prevent looping/repeated parsing of extra_context */ have_extra_context = true; - base = extra_data; + base = (void __user *)extra_datap; if (!IS_ALIGNED((unsigned long)base, 16)) goto invalid; if (!IS_ALIGNED(extra_size, 16)) goto invalid; - if (extra_data != userp) + if (base != userp) goto invalid; /* Reject "unreasonably large" frames: */ @@ -337,7 +337,7 @@ static int parse_user_sigframe(struct user_ctxs *user, /* * Ignore trailing terminator in __reserved[] - * and start parsing extra_data: + * and start parsing extra data: */ offset = 0; limit = extra_size; @@ -501,7 +501,7 @@ static int setup_sigframe(struct rt_sigframe_user_layout *user, struct extra_context __user *extra; struct _aarch64_ctx __user *end; - void __user *extra_data; + u64 extra_datap; u32 extra_size; extra = (struct extra_context __user *)userp; @@ -510,12 +510,12 @@ static int setup_sigframe(struct rt_sigframe_user_layout *user, end = (struct _aarch64_ctx __user *)userp; userp += TERMINATOR_SIZE; - extra_data = userp; + extra_datap = (u64)userp; extra_size = sfp + round_up(user->size, 16) - userp; __put_user_error(EXTRA_MAGIC, &extra->head.magic, err); __put_user_error(EXTRA_CONTEXT_SIZE, &extra->head.size, err); - __put_user_error(extra_data, &extra->data, err); + __put_user_error(extra_datap, &extra->datap, err); __put_user_error(extra_size, &extra->size, err); /* Add the terminator */