From patchwork Mon Mar 16 19:04:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Metcalf X-Patchwork-Id: 6024171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8808F9F314 for ; Mon, 16 Mar 2015 19:11:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6960202F8 for ; Mon, 16 Mar 2015 19:11:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9E6BF202E6 for ; Mon, 16 Mar 2015 19:11:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YXaO6-0001L7-UJ; Mon, 16 Mar 2015 19:09:18 +0000 Received: from mail-am1on0088.outbound.protection.outlook.com ([157.56.112.88] helo=emea01-am1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YXaO1-00018T-5T for linux-arm-kernel@lists.infradead.org; Mon, 16 Mar 2015 19:09:14 +0000 Received: from DB5PR02CA0019.eurprd02.prod.outlook.com (25.161.237.29) by AM2PR02MB0532.eurprd02.prod.outlook.com (25.160.56.140) with Microsoft SMTP Server (TLS) id 15.1.112.19; Mon, 16 Mar 2015 19:08:48 +0000 Received: from DB3FFO11FD001.protection.gbl (2a01:111:f400:7e04::162) by DB5PR02CA0019.outlook.office365.com (2a01:111:e400:5805::29) with Microsoft SMTP Server (TLS) id 15.1.112.16 via Frontend Transport; Mon, 16 Mar 2015 19:08:48 +0000 Received: from farm-0002.internal.tilera.com (12.216.194.146) by DB3FFO11FD001.mail.protection.outlook.com (10.47.216.90) with Microsoft SMTP Server (TLS) id 15.1.125.13 via Frontend Transport; Mon, 16 Mar 2015 19:08:47 +0000 Received: (from cmetcalf@localhost) by farm-0002.internal.tilera.com (8.14.4/8.14.4/Submit) id t2GJ8fs5021877; Mon, 16 Mar 2015 15:08:41 -0400 Message-ID: <201503161908.t2GJ8fs5021877@farm-0002.internal.tilera.com> From: Chris Metcalf Date: Mon, 16 Mar 2015 15:04:05 -0400 Subject: [PATCH] tile: use si_int instead of si_ptr for compat_siginfo In-Reply-To: <20150225103750.GC22206@localhost> References: <20150225103750.GC22206@localhost> <1423563011-12377-1-git-send-email-bamvor.zhangjian@huawei.com> <20150210122718.GC32052@e104818-lin.cambridge.arm.com> <54DB3B60.4050100@huawei.com> <20150211154054.GD9058@e104818-lin.cambridge.arm.com> <54DDAF2B.2070707@huawei.com> <20150213104455.GA3508@e104818-lin.cambridge.arm.com> <54DE730D.3090100@ezchip.com> <20150214112220.GB10246@MBP.local> <54ECF309.3020509@ezchip.com> To: X-EOPAttributedMessage: 0 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning tilera.com discourages use of 12.216.194.146 as permitted sender) Authentication-Results: spf=softfail (sender IP is 12.216.194.146) smtp.mailfrom=cmetcalf@tilera.com; vger.kernel.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:12.216.194.146; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(105596002)(106466001)(960300001)(47776003)(50466002)(48376002)(46102003)(42186005)(86362001)(19580395003)(19580405001)(6806004)(77156002)(54356999)(92566002)(62966003)(2950100001)(93886004)(104016003)(50986999)(229853001)(87936001)(110136001)(2351001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR02MB0532; H:farm-0002.internal.tilera.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR02MB0532; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5002010)(5005006); SRVR:AM2PR02MB0532; BCL:0; PCL:0; RULEID:; SRVR:AM2PR02MB0532; X-Forefront-PRVS: 05177D47DC X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2015 19:08:47.4186 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[12.216.194.146]; Helo=[farm-0002.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR02MB0532 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150316_120913_545604_7E1ECA22 X-CRM114-Status: UNSURE ( 7.78 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: linux-arch@vger.kernel.org, ralf@linux-mips.org, benh@kernel.crashing.org, deller@gmx.de, "dingtianhong@huawei.com" , heiko.carstens@de.ibm.com, jejb@parisc-linux.org, Will Deacon , "lizefan@huawei.com" , Bamvor Jian Zhang , mpe@ellerman.id.au, hpa@zytor.com, schwidefsky@de.ibm.com, paulus@samba.org, tglx@linutronix.de, mingo@redhat.com, davem@davemloft.net, "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To be compatible with the generic get_compat_sigevent(), the copy_siginfo_to_user32() and thus copy_siginfo_from_user32() have to use si_int instead of si_ptr. Using si_ptr means that for the case of ILP32 compat code running in big-endian mode, we would end up copying the high 32 bits of the pointer value into si_int instead of the desired low 32 bits. Signed-off-by: Chris Metcalf Cc: Catalin Marinas --- arch/tile/kernel/compat_signal.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index 8c5abf2e4794..bca13054afb4 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c @@ -68,7 +68,7 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *fr if (from->si_code < 0) { err |= __put_user(from->si_pid, &to->si_pid); err |= __put_user(from->si_uid, &to->si_uid); - err |= __put_user(ptr_to_compat(from->si_ptr), &to->si_ptr); + err |= __put_user(from->si_int, &to->si_int); } else { /* * First 32bits of unions are always present: @@ -93,8 +93,7 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *fr break; case __SI_TIMER >> 16: err |= __put_user(from->si_overrun, &to->si_overrun); - err |= __put_user(ptr_to_compat(from->si_ptr), - &to->si_ptr); + err |= __put_user(from->si_int, &to->si_int); break; /* This is not generated by the kernel as of now. */ case __SI_RT >> 16: @@ -110,7 +109,6 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *fr int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from) { int err; - u32 ptr32; if (!access_ok(VERIFY_READ, from, sizeof(struct compat_siginfo))) return -EFAULT; @@ -121,8 +119,7 @@ int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from) err |= __get_user(to->si_pid, &from->si_pid); err |= __get_user(to->si_uid, &from->si_uid); - err |= __get_user(ptr32, &from->si_ptr); - to->si_ptr = compat_ptr(ptr32); + err |= __get_user(to->si_int, &from->si_int); return err; }