From patchwork Wed Mar 1 19:19:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9599073 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 B51E5600CB for ; Wed, 1 Mar 2017 19:48:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A38CF2856E for ; Wed, 1 Mar 2017 19:48:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9777628576; Wed, 1 Mar 2017 19:48:44 +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=BAD_ENC_HEADER,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 A940E2856E for ; Wed, 1 Mar 2017 19:48:43 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=DkmeRwOHpcoZ850dvfm5oAUf//ZU+UAyiZ/pxMndQII=; b=AfE3ixkooNukJW d6HVLCD37nx0PTtbdM2obm/gNndrz3Ep+RVr3u5uHn3jmLGCCgYrbMeubenfJ5TZnK1ocUQk/UuA5 Mmi1e37Xuw/q9E2gsE4lnGTGFbIO61Gumr7O9L+VUeyoJEVz4+seLX97CpRwHMcqbdhRlw1VLhlKF EJBcB/Bq8vHOoLzZtaFupdGxTI9Wisj/nDKcHw6FVI13qFHTSIqlxLNGQSWdh8kHdENFxN9rScDjL qlZ9x4Gs9YA7jdhzmqPA70n5duJ6Qts+b9uHjPfiuD7ufVG5mT9CMnpMzKu7vRgJPjQTsP+LTdiLd wfkfaVwjT9yiuAM3qyrQ==; 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 1cjAEs-0003Pj-6r; Wed, 01 Mar 2017 19:48:42 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjAEU-00039K-ON for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Mar 2017 19:48:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p7vA5waVmPEl8vKlVc98Vx0xVyOq1Nd5UbCR81Eh16w=; b=BbXH5u/lxgf+fmayzWZyaEuld xZfqh6vTNx3L/0LnZ5A2Nd8kUPrOg8SWvF2IBR7voC7275jKzNuuvryrkfQeTtDMvOjxOk5Yh7Y0Q Lu6hJDGhDuqHnN2GLXyaoHfdYzfpaxynTBlJNVjCwQf1oE5aHU9zm8XxZ8BVYUc0aWfV5n3YdUIMN HVMo1TfJ5WunZKUkeWPHTyXxKdALEmsniQn9R8Ss23PGIhA9FTPmDspu8oYeW1bCGLM4aqGe18JMs noCwOmoYvYO4jJWnO17WkFmwTFOsr0IjzzMG7vAJWOMQ0KOmGhHQZJ3sLsJy8D5LSa2TSZXE9qwHd kCROhELNQ==; Received: from mail-bn3nam01on0040.outbound.protection.outlook.com ([104.47.33.40] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cj9qA-00087f-Qp for linux-arm-kernel@lists.infradead.org; Wed, 01 Mar 2017 19:23:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=p7vA5waVmPEl8vKlVc98Vx0xVyOq1Nd5UbCR81Eh16w=; b=lm4jnldDe8WrLQWpsVbm+KLk2wpOfp9wUjwbbQ0KEvGMIBvifEl0QTUfXoy0AUWX9aIBPKGuvtgqwW1PaHJx7YYIOWthkuQ2X8OSuM8aZS538OTXB8deGl8UabDB64lPWhR/zbCrHb7BlfbFwxtTnM9tthPvDqWESN4Ses+y5VI= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none; lists.infradead.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost (27.97.135.110) by SN1PR07MB2255.namprd07.prod.outlook.com (10.164.47.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Wed, 1 Mar 2017 19:22:47 +0000 From: Yury Norov To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Arnd Bergmann , Catalin Marinas Subject: [PATCH 16/20] arm64: signal32: move ilp32 and aarch32 common code to separated file Date: Thu, 2 Mar 2017 00:49:24 +0530 Message-Id: <1488395968-14313-17-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488395968-14313-1-git-send-email-ynorov@caviumnetworks.com> References: <1488395968-14313-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [27.97.135.110] X-ClientProxiedBy: AM5PR0101CA0008.eurprd01.prod.exchangelabs.com (10.169.240.18) To SN1PR07MB2255.namprd07.prod.outlook.com (10.164.47.149) X-MS-Office365-Filtering-Correlation-Id: 66fac827-3b5e-44a7-d977-08d460d858da X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN1PR07MB2255; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2255; 3:br/ktN7/ZgMX/sOt36qZF8TGl76eLV5wxYN/U75hab0ewphbdFowPPqSQFU5oS4/+2wPssPx1fHmWKiMDovCb6HRrZvUQMMPHgv9mFiIBaqQqB/ybT67K84EV0AaWIvjr4Cwbg9KuW9CS8FXmh2/4lMyxpjs533IvjU/ViTZ0yGCkPY+Q8P+gS1hrn/SwFupaHYF6BbGgdJXIPnq/7E/MG+fIL/ufW3m7KHtm56BAbZjiUyCdnBc0g++ep9iLLU9BIWmFaZzEyy+rfItZ+PdpQ==; 25:Xl6nMx0rXEI892y487yakywrsyHAgnaYxm+q0ct/apJay+Xobr0QxUnsu4FXSwlu3L6bup9TmzRc7MDfr2TA1/Mx2hcJIe3PrNJ+oNxjcXlv0VLBL6x7cuFpFW1Jtv4jRCDavqPS3OHl0nCJ7j1Hs+d2rHS3ZWWf80Bjc9pPj6LvvDmpGYfNPJvn5Jot+GiZI5B2NSURo8g8dTaD/AOo7z/f2wa1nVXC5Kik7Zsis8khHA91Z13ChS0BDsZxxWjkk3UlU3C3M11cKwra7F7R1J3OTihIT/rLje9H8Nd0EE1R2eBLv2hzp5xsHiVWLOa2jPr+1YKFz+5Gy3n9NtDQQeRarQF6GLkX9kH2rSmGosqoY8GwctURnbcUhrJt21Uwb+nFCcinbb4v/31zY2FAUytGO1hoaWEkBTiMUPJw+mFMfIBhEnORahVtJb/E9dfdUGeAqxUahQ4fqo99fjMpOA== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2255; 31:Dq34M2hwdlIaQVKXDI0dpSeA9VL+whQBqE1sYJ0cuaPCtLIK4DBpJ6zoOI7IG36JpHahMMqHxiAfAKSICCpDIsPu7j7w37DAQL2vrz1Uitmf141VrZzR4mXi3Zy2YqlBMVkLQCsUiM+dABurYt+hb4tF3Y1Mg6WaGlTuK5oVgJuW2kWMlyxM5NTKgSpjjJWvWllMZTUisdkplwIrGj7KqpF/APCO+wDN1YU81ZUBSjE=; 20:gzcbgbyv1b4nSycfk04qbKlnxWzmn2lMwHhFgIr6A53HQNJAxUtZgvdYERduM/4x5dNqkckN9NrR2OKKHbvvynAD6MbwmBGczmNIQn8oowPXGMYQrp99mqxku2C8PQgPcMVNG7iyc7QjzgtcfY4Nggdi1fXvzFRXn7MBM+y4OUGPzf+H0KsU5YYR9gyZtqzcFZya/aXDmiUIbnrJNDx87M32ikdiyab0EVu2SlapvXJw1GU65q3SIlcDRaVIDZmXPPIyuPnuW8kLVmYzWrk/uFWD/rM1QV33sn+1dSZCFhDQ5DtU6/bWwqYvaCE9m7jxCTs5H2Es2emq35GE8ZrPmLiijvNYmuwfcJ9ZuX4hOoRYHQdVnswYA+YQ9M97IWq6hyovTM+PZPnQp9VKOU8eiBcjQhby6IW38lXLofJ3N9WKe8YHIjDt4RplG3dR2lyAsvhqvUi0rwMCmtxKwXzTiARA3Zzlf3MyCYIeu24Ei2M+2RDSI0dqTcelxfQlx5PjfpeFurQLbhnS6/s/s4OXVdX7/1UFL+Dyewn5/7AqEz4EQhMxooFjUuQtHiP5urTVxHZl0LX4mxzP9nOldiBWGhrgSvDTvhdd1p1KSQppfR8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(180628864354917)(22074186197030)(192374486261705); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123562025)(20161123558025)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:SN1PR07MB2255; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2255; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2255; 4:lYqIEVyRfwb++17XkodtNbGcjr8s+wx2nLyEcB6TEY37CD++C/FeJkuVKyHRyxEktPAYOV/5Wt2M7qQNAFUydibKypD3fpdZH0pysQxZHLyuQc/vi0oOyspFM8db72Yde+FKFPHCMDN2eoe+vnq0+9LMf4Twtsz9pVPLudetANVIfD996JidrsHo4jaa4ge4CGhTCv5I50VGwVGmd/Je0OYAXD6UfaaJxCEVRYBQGuEsXI7Cb+SSy5q6nca87qJEnMR5HqSdYsblYT97zNQU/+dXKOE4L83c+dnDuQZ7XAny43UTxmOYbyqA2Tg1je0A63p3aZ7uoEQp8vMvnxAgBNEdjpw+jlLAMtuljbubUzqL7DV10UnY4hgOhDHzdfa0Gc49nTzfBOn5Jk0gYX8kEC6VxjdeJIh+JpiK1T57HmhRir5dipkEeW27qtz+ykVvfNwVJRmmCMUSwp5Y0qKRszSbTG6SwLuaFEPKGrLNkFzdGudsbtB5dz3akPDrm7QObf8hgOwev/t6TRmq8jYiY3EM0PIsY0bz1stWQ7a63RuHLhpZ+ZW/yjENTNjwg0ApPWrBRhmpygedDKUgaWIecl3oDBZ3AIa8nS0Bd49ZPzf7Ubmvq490CJii2JcqSp2v1hQYZ2WVnMy4CD/FP1taltyrkHrxb0ic4eZ49sKPs4nC//gGEiRrTumNCCdb6U3NSEfEkDO6GKolKzSIuqBeFC/kLftsWkyEw6FtxjmUxFYSH+ns5+1gGDoZQvY97wQt X-Forefront-PRVS: 0233768B38 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(2906002)(6306002)(575784001)(76506005)(92566002)(54906002)(38730400002)(66066001)(6496005)(4326008)(53936002)(47776003)(5009440100003)(36756003)(305945005)(50986999)(76176999)(7736002)(6116002)(3846002)(6666003)(189998001)(7416002)(5660300001)(48376002)(50466002)(8676002)(42186005)(2950100002)(81166006)(25786008)(33646002)(50226002)(6486002)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2255; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2255; 23:H0M19ahPF4YEZJbzb7RCfTCsWgAeQgKnSTbDtScmm?= =?us-ascii?Q?o2Yu2C0bohjoOZ7AIIfWup+K84j55+ngDWvTTDxjT9JOqrYLTS+3GqUx384N?= =?us-ascii?Q?HFP4fVPT04Bvi2Kl9SJkK3hz6XYLUdtucKst6avVMLrQiovFPEo9jzHoMKVc?= =?us-ascii?Q?iwQrVUBIM2nKGmKblxg5x1WbSxGMNGIMk3dnig+GwWqWttkBjhcAL/jUacv6?= =?us-ascii?Q?WaqP2j71n20Ds8Ok++JdcY/KAlSuSC20KsxyoAkjuy+cXsbJ9mY0BsCY2K6G?= =?us-ascii?Q?adXmyOe+D2bwTWU6AiVCQtNykau/5H6M+9uoCQOEDtGigTLwdKsJXUHBsC/F?= =?us-ascii?Q?N2qiCulAsvNkIUrgerDwoYEZbehPW5G54Yh+qUKX6Qqs08lbB2qfhnquZbG2?= =?us-ascii?Q?5u4N0V9fN78144U3m+QN0ikJW5xdxKVsI5x+IgCw1ItT5TX+Wcx+7Lt7DazQ?= =?us-ascii?Q?ThKcj7w+Rc0aeG5TFeH6WOCZkQrlLzHXH+Exu/9iGzN00Ck4NmS7Bir28uAk?= =?us-ascii?Q?iMcWcOSfcrTbJ5Fiu5OHL4gyDJHi+XbOQ5kETS6BLxGO6QAUmy52GtnEQHB9?= =?us-ascii?Q?YRovWbM7EgCZIGX3sgdVK0YMqgo9a5BKLK0rNhOgISLfXOZbfsPzLY1GyC6W?= =?us-ascii?Q?zOPfl652IdD4wX3DW6YG7IcGZNM1zHCbTwXIAudjjTzBdd3ghco/cCpvWJjx?= =?us-ascii?Q?FGkDceBxjy04oRqG2iGBW3gNWkKsuYY9AhT+ib7AW9G3iSrNhN8uw2suHO6+?= =?us-ascii?Q?dW7+lD7s7JpTAZEenCX+dzCRGRY3xbW9Qjrpb+4SSNslswyD/jAQF4rwbFNe?= =?us-ascii?Q?cZoeN0OOp2kiXzdRsX8D6uyBW7edbPxM2YlBR3qe13nPu8sW1ocpQglIRARl?= =?us-ascii?Q?Msx2zUFjSpRpy9IFV41lxz1cAtKH/Bmp59oQMh1VAQPQSf0lTAVQtOFT3mtk?= =?us-ascii?Q?/T0CKzGPqCrDyRFt+Y9LIi8bgrOT4AqleONGq5T1aC8Ysm0cB315ws39Caaa?= =?us-ascii?Q?XdPd06SeHwCSUtzx/ASif5h?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2255; 6:fBIvX3VFWJcp3TDDCHV74vdNdDQFao6kgRRGizUAW1B2nE8Xh0dkjfeRRlIqChUmDh7W+xl9hlW3BEw9gwU55AXbSb+oGszNYkS/gm9cmsCa8RIx6w24VQ80AKiiAHtNuQsR1ucmH/eT2ZP/WikzxJPv28NxMX74ozxP5X1yLAO4tFADOBf0H1/ilhxC2lAaP6UE761xYQWAeK1khenCD6ayq6iRC2YI4nChh/izi9Xfsgo9Y5C4vbs/48hR21Og11rl4t8HiHpiSZ6s6ecpZeCoCqd+YQLmm5zrK97SH9tWsrZ08qiupdxe/IqKuyXDWjJ4XosBlmZXwdk70/1Lchj45E8wrivKhhVmF565or+6V/SToewVTUocMwGeTC9jK7d7c7/Hp6sBll8gwS3jgA==; 5:Cp+64TzTS4tkase9uzuMWCHcqVWilQanTGSc+Old5vyZiOuXAb7+C7MSteslG6QMhLMHz4zHagemBTrT9mXCynesesH6MNHIl8BAxfuo6SfGEzPpjzCpsel/YGlYEWNzdaT9IK7lKn/xAxr0q3s+M/OW5OoRjfJSn/8TmVQa9GM=; 24:JRRmGW3x2E/fDzMgFrot9OwYWv+xXAoFJLEXrbi9gn+jZ9Y8j/pfE4K+5wTkyfCFr7rKLC5+Z17HitCDp7ljiBgcRt7R91jkkFar67x1T0w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2255; 7:y7b+zD93Ye6Qux58KvSDgqaBENmTNmgmZPkMbArQ6zlwi4yijyXc2GzmK94MiQmmLbgsWGPOh4K3kcI9hWJSVHA3pBvVp7jsHr1Gj5YCeT6pOI8+FLxuwi+bH8WshcwwznKTbK7xlZgwJjqRRE+81B8zgEec8iSE58BSSXKMozns3u5gNe2DmJb3ae4cY50yRaqikJxWH4i4IwUMbcHN844kdGa7wIwobjJ65tL0y8kP3YJno+WjVBW5eIDBqkgkk/sYFs07m1BLljv8+7BRGiiTijpdIG/nahS5/gd9LxpHnShhqCF8nMwQMGYNrBYzujhGS12Fq/hZ0nhvYGYnrA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2017 19:22:47.6959 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2255 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170301_192311_172133_66DA093D X-CRM114-Status: GOOD ( 19.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: Andrew Pinski , Heiko Carstens , Chris Metcalf , Yury Norov , philipp.tomsich@theobroma-systems.com, Joseph Myers , zhouchengming1@huawei.com, Steve Ellcey , Prasun.Kapoor@caviumnetworks.com, Andreas Schwab , agraf@suse.de, szabolcs.nagy@arm.com, geert@linux-m68k.org, Adam Borowski , manuel.montezelo@gmail.com, Chris Metcalf , Andrew Pinski , linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, Bamvor Zhangjian , Maxim Kuvyrkov , Florian Weimer , Nathan_Lynch@mentor.com, Ramana Radhakrishnan , schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com 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 Signed-off-by: Yury Norov --- arch/arm64/include/asm/signal32.h | 3 + arch/arm64/include/asm/signal32_common.h | 27 +++++++ arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/signal32.c | 107 ------------------------ arch/arm64/kernel/signal32_common.c | 135 +++++++++++++++++++++++++++++++ 5 files changed, 166 insertions(+), 108 deletions(-) create mode 100644 arch/arm64/include/asm/signal32_common.h create mode 100644 arch/arm64/kernel/signal32_common.c diff --git a/arch/arm64/include/asm/signal32.h b/arch/arm64/include/asm/signal32.h index e68fcce..1c4ede7 100644 --- a/arch/arm64/include/asm/signal32.h +++ b/arch/arm64/include/asm/signal32.h @@ -13,6 +13,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +#include + #ifndef __ASM_SIGNAL32_H #define __ASM_SIGNAL32_H diff --git a/arch/arm64/include/asm/signal32_common.h b/arch/arm64/include/asm/signal32_common.h new file mode 100644 index 0000000..36c1ebc --- /dev/null +++ b/arch/arm64/include/asm/signal32_common.h @@ -0,0 +1,27 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef __ASM_SIGNAL32_COMMON_H +#define __ASM_SIGNAL32_COMMON_H + +#ifdef CONFIG_COMPAT + +int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from); +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from); + +int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set); +int get_sigset_t(sigset_t *set, const compat_sigset_t __user *uset); + +#endif /* CONFIG_COMPAT*/ + +#endif /* __ASM_SIGNAL32_COMMON_H */ diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 4ea7b97f..9463af5 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -30,7 +30,7 @@ $(obj)/%.stub.o: $(obj)/%.o FORCE arm64-obj-$(CONFIG_AARCH32_EL0) += sys32.o kuser32.o signal32.o \ sys_compat.o entry32.o binfmt_elf32.o arm64-obj-$(CONFIG_ARM64_ILP32) += binfmt_ilp32.o sys_ilp32.o -arm64-obj-$(CONFIG_COMPAT) += entry32_common.o +arm64-obj-$(CONFIG_COMPAT) += entry32_common.o signal32_common.o arm64-obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o arm64-obj-$(CONFIG_ARM64_MODULE_PLTS) += module-plts.o diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index c747a0f..181cc30 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -103,113 +103,6 @@ struct compat_rt_sigframe { #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -static inline int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) -{ - compat_sigset_t cset; - - cset.sig[0] = set->sig[0] & 0xffffffffull; - cset.sig[1] = set->sig[0] >> 32; - - return copy_to_user(uset, &cset, sizeof(*uset)); -} - -static inline int get_sigset_t(sigset_t *set, - const compat_sigset_t __user *uset) -{ - compat_sigset_t s32; - - if (copy_from_user(&s32, uset, sizeof(*uset))) - return -EFAULT; - - set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); - return 0; -} - -int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from) -{ - int err; - - if (!access_ok(VERIFY_WRITE, to, sizeof(*to))) - return -EFAULT; - - /* If you change siginfo_t structure, please be sure - * this code is fixed accordingly. - * It should never copy any pad contained in the structure - * to avoid security leaks, but must copy the generic - * 3 ints plus the relevant union member. - * This routine must convert siginfo from 64bit to 32bit as well - * at the same time. - */ - err = __put_user(from->si_signo, &to->si_signo); - err |= __put_user(from->si_errno, &to->si_errno); - err |= __put_user((short)from->si_code, &to->si_code); - if (from->si_code < 0) - err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, - SI_PAD_SIZE); - else switch (from->si_code & __SI_MASK) { - case __SI_KILL: - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - break; - case __SI_TIMER: - err |= __put_user(from->si_tid, &to->si_tid); - err |= __put_user(from->si_overrun, &to->si_overrun); - err |= __put_user(from->si_int, &to->si_int); - break; - case __SI_POLL: - err |= __put_user(from->si_band, &to->si_band); - err |= __put_user(from->si_fd, &to->si_fd); - break; - case __SI_FAULT: - err |= __put_user((compat_uptr_t)(unsigned long)from->si_addr, - &to->si_addr); -#ifdef BUS_MCEERR_AO - /* - * Other callers might not initialize the si_lsb field, - * so check explicitly for the right codes here. - */ - if (from->si_signo == SIGBUS && - (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) - err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); -#endif - break; - case __SI_CHLD: - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - err |= __put_user(from->si_status, &to->si_status); - err |= __put_user(from->si_utime, &to->si_utime); - err |= __put_user(from->si_stime, &to->si_stime); - break; - case __SI_RT: /* This is not generated by the kernel as of now. */ - case __SI_MESGQ: /* But this is */ - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - err |= __put_user(from->si_int, &to->si_int); - break; - case __SI_SYS: - err |= __put_user((compat_uptr_t)(unsigned long) - from->si_call_addr, &to->si_call_addr); - err |= __put_user(from->si_syscall, &to->si_syscall); - err |= __put_user(from->si_arch, &to->si_arch); - break; - default: /* this is just in case for now ... */ - err |= __put_user(from->si_pid, &to->si_pid); - err |= __put_user(from->si_uid, &to->si_uid); - break; - } - return err; -} - -int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) -{ - if (copy_from_user(to, from, __ARCH_SI_PREAMBLE_SIZE) || - copy_from_user(to->_sifields._pad, - from->_sifields._pad, SI_PAD_SIZE)) - return -EFAULT; - - return 0; -} - /* * VFP save/restore code. * diff --git a/arch/arm64/kernel/signal32_common.c b/arch/arm64/kernel/signal32_common.c new file mode 100644 index 0000000..06f0258 --- /dev/null +++ b/arch/arm64/kernel/signal32_common.c @@ -0,0 +1,135 @@ +/* + * Based on arch/arm/kernel/signal.c + * + * Copyright (C) 1995-2009 Russell King + * Copyright (C) 2012 ARM Ltd. + * Modified by Will Deacon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +int put_sigset_t(compat_sigset_t __user *uset, sigset_t *set) +{ + compat_sigset_t cset; + + cset.sig[0] = set->sig[0] & 0xffffffffull; + cset.sig[1] = set->sig[0] >> 32; + + return copy_to_user(uset, &cset, sizeof(*uset)); +} + +int get_sigset_t(sigset_t *set, const compat_sigset_t __user *uset) +{ + compat_sigset_t s32; + + if (copy_from_user(&s32, uset, sizeof(*uset))) + return -EFAULT; + + set->sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32); + return 0; +} + +int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from) +{ + int err; + + if (!access_ok(VERIFY_WRITE, to, sizeof(*to))) + return -EFAULT; + + /* If you change siginfo_t structure, please be sure + * this code is fixed accordingly. + * It should never copy any pad contained in the structure + * to avoid security leaks, but must copy the generic + * 3 ints plus the relevant union member. + * This routine must convert siginfo from 64bit to 32bit as well + * at the same time. + */ + err = __put_user(from->si_signo, &to->si_signo); + err |= __put_user(from->si_errno, &to->si_errno); + err |= __put_user((short)from->si_code, &to->si_code); + if (from->si_code < 0) + err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, + SI_PAD_SIZE); + else switch (from->si_code & __SI_MASK) { + case __SI_KILL: + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + break; + case __SI_TIMER: + err |= __put_user(from->si_tid, &to->si_tid); + err |= __put_user(from->si_overrun, &to->si_overrun); + err |= __put_user(from->si_int, &to->si_int); + break; + case __SI_POLL: + err |= __put_user(from->si_band, &to->si_band); + err |= __put_user(from->si_fd, &to->si_fd); + break; + case __SI_FAULT: + err |= __put_user((compat_uptr_t)(unsigned long)from->si_addr, + &to->si_addr); +#ifdef BUS_MCEERR_AO + /* + * Other callers might not initialize the si_lsb field, + * so check explicitly for the right codes here. + */ + if (from->si_signo == SIGBUS && + (from->si_code == BUS_MCEERR_AR || from->si_code == BUS_MCEERR_AO)) + err |= __put_user(from->si_addr_lsb, &to->si_addr_lsb); +#endif + break; + case __SI_CHLD: + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + err |= __put_user(from->si_status, &to->si_status); + err |= __put_user(from->si_utime, &to->si_utime); + err |= __put_user(from->si_stime, &to->si_stime); + break; + case __SI_RT: /* This is not generated by the kernel as of now. */ + case __SI_MESGQ: /* But this is */ + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + err |= __put_user(from->si_int, &to->si_int); + break; + case __SI_SYS: + err |= __put_user((compat_uptr_t)(unsigned long) + from->si_call_addr, &to->si_call_addr); + err |= __put_user(from->si_syscall, &to->si_syscall); + err |= __put_user(from->si_arch, &to->si_arch); + break; + default: /* this is just in case for now ... */ + err |= __put_user(from->si_pid, &to->si_pid); + err |= __put_user(from->si_uid, &to->si_uid); + break; + } + return err; +} + +int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) +{ + if (copy_from_user(to, from, __ARCH_SI_PREAMBLE_SIZE) || + copy_from_user(to->_sifields._pad, + from->_sifields._pad, SI_PAD_SIZE)) + return -EFAULT; + + return 0; +}