From patchwork Wed Mar 1 19:19:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9599033 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 45E1160453 for ; Wed, 1 Mar 2017 19:29:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31F94204C1 for ; Wed, 1 Mar 2017 19:29:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2640B2854E; Wed, 1 Mar 2017 19:29:09 +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=unavailable 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 9EC14204C1 for ; Wed, 1 Mar 2017 19:29:08 +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=/OJ9nPKx6jpsSKegmuVT4STllV5InLIlvFQIopJXtbI=; b=Pft5xcQJ75x+0Z nlRjKBx4I9mQ64Yh52AHufINPVZ26mG+jHpHKwwjqV4JJu3tcnl26r+jMyX9pn2K+OQlu7zLM87wt /AjOTCirYQM2zFHgEcPAaEiU2OM+F82iygExU/ZEp9beE2uBWqLzxeAYSO6c2FJ4m88itUxGOhYP1 pqA2tezGqKEgsIQK2x4R4PCDlUNUvvqClW35VzBVd9oFk0GKwFPLgJmp9ZRUpRGTkSI5Y+BKeP4EA AWUme5jfnrjAscRaj1z7O7XlcV/X98QawLef2N9UMEhgQ8GZWzBnvrZhk+BE95WZw7RhUvWjr3EcP SzSPJnRMyCVhhObIGCPA==; 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 1cj9vw-0000mD-9x; Wed, 01 Mar 2017 19:29:08 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cj9qa-0003Ut-Ob for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Mar 2017 19:23:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=0PGwg9aJNc0thMC9+9jPh9ETKPDbzM/r88kaFrvWCEQ=; b=CotbNxVuYG3QhPd6Mg1ue/48+ q/V8Gv3hJnuJIfymWLHdJi9RgVD4D9xSvRN0W81gnIzn0raaTPSJD/TTaLVvz6pgGh08tGZe94w4/ 4vA5iwuJ4otrJ0rGEXKjj9BrV81DVZI+yHqCRNjtRGMaDpHQumhwaU4skhCD6STfmIzp/Rl8Ww1am Dl+6ZW85aouxByJYwdjCyhUjEGTV+XppZEvdDjktuX6qjjCNqECWVX7ZqxqT3i9HIZDpI7tS+WiNX sqDosP6BB0JznZ5d0j7bwprIRTQhB4RZmdlow+Y/fCqhEfcUNeBeV2Hd6nKoZy1Yg77Qr/WVIMBh7 KDoJR/zGg==; Received: from mail-sn1nam01on0040.outbound.protection.outlook.com ([104.47.32.40] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cj9qZ-0002ek-7k for linux-arm-kernel@lists.infradead.org; Wed, 01 Mar 2017 19:23:36 +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=0PGwg9aJNc0thMC9+9jPh9ETKPDbzM/r88kaFrvWCEQ=; b=uIEvkDxXg6k0J1K/OWFqMVx2Oi7HT8QfZ4X2xwOwjNiKwKEgVARrHeYCFMmDXP9/7n7vx6S5l0OpJlcSlPnDTnPvytSPu29rPszV7QcZPf6mNjZ/RslM9Mch6uBKca6lAoQotP0EFPKs212fPVpG9nT1DlzOvpdn5og6+nwM0Xk= 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 DM3PR07MB2249.namprd07.prod.outlook.com (10.164.33.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Wed, 1 Mar 2017 19:23:10 +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 18/20] arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 Date: Thu, 2 Mar 2017 00:49:26 +0530 Message-Id: <1488395968-14313-19-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: HE1PR0802CA0015.eurprd08.prod.outlook.com (10.172.123.153) To DM3PR07MB2249.namprd07.prod.outlook.com (10.164.33.147) X-MS-Office365-Filtering-Correlation-Id: a43768ce-0e4e-4ded-7f82-08d460d867be X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM3PR07MB2249; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 3:k0jU9qPAJnRV6zWsNbAmchnZmgxn5H8dRUoZ8ZfJRXSafnIpDt6Nbijwgn6BYJjPjJTvIQsyUMtrbb7rg5VL+zxJOJ8ygcVg4+cqtDkgNgSYyCy3yWFnLl5ZgPO96+5cub3v+U+wWdIrX1bzsubZIS6jOeGtChPtGT56bohfgwTcK66RWlJd0izmHKvX7QuXJxxnMokV8UaEoajhTmr2xkyyapiBq2t6s6YMcLxOOorjOT2bYbq1UbOBUG2cwRD5Aww1+Gyx8ZJ72thybEzm+Q==; 25:sPXMD417gkopBDTPj5sS/epz7bma0o3yxB1enbeyxUUqS6ryGOtmas4F+4eTmnwxx4TB2gEZzW9/yG4ER7VuRcTRvXDzYwVsqmGNPNstIRHFzqXjWtZrDFHRqqkmRXlLgVU5b77GQNAwf2gyFwVdUSOOrUdleyO9q11vmWpTOwmtlfbeZHcNWGHKns9dujMNjFaa3q+0eSQsWBkj9OTTch223j4HhEH7cbDkYkl7/EbY+oxxj6J9kDn94UpusmRJJX4cKGVy44ola/6ZfB8nhSHpcWJl7N1g+5nG9c/RLvuh7d/kEvy/+M1E+PaRw0T1EaOX0r5lKVFC9SDHKkhKB/zwraL+fAkOysdbjOCGUVtJoDPdgvW6ek3XKM5ucxzY/NlQhtew4sJY7EVOBTkNlspteSSV/r0To8K9tEv4bfx+f24cVj/CIWlBdOg/AESn85hFc4SZ97+RldA6r1/vog== X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 31:3EV3XIjB7PP/ETvbwgGVdfYsoP0toZNOEmP9H4SToB77El5XzEQZ/PXBcHCOZOOIAI3ChMoBTbmsMk+0S1t31Z645lIDJPP5Rh8exHEtdsI4WxKhxHrH3f/q2X3M9wgdK4YTa4ItDJbp1fyfYNx52e/mQ7ANPzAaGHpmGppthC6GoLrjZ2j0t1DJL0I3Jz1z0d7jZDNyuQKs7jLoO86U7KVM1PRyf38eRmix/+P2/9g=; 20:z2ECsiCpGERoVbSO+Zc7vLCe3VfVdy6q+BaF1Msz944xqEBXdPhqwvwiIywks9LGPtqrZf7pyAbBG+yxtt44xlJf59Ee6GgyxCg+7krNSjvkYvPky9i5LnyScbUlBi/4TkFETShyzvOQWXE4ShFGA9Q+26xwO4FbOlo9tsVs/D43Yl57aveE/nNRI/b/bz/9Z9U+krYAjlrPUoqrRDNqI1+LFjhKgnnfaYN/4iU+etbCDtS2AVtccznwNnvzDfaciDKXOWMjZ/bEDs2HIzNQ7W+myNoOG8QxrkcDgacZb0uxOG0NwoDFOcAm8FIUxMZ/FGMl/Lr948tfxsS4HMbkEyRprMH7Ad4aCODlrhKHK2heWmqmvTGfj6gWD9Qqi5i14FunZtho5vHPdeiBSFEk+Fuw2Y8mcTLtVT3Tx5RCTTAw14Fzhqn/0aN9yLv7nucvJIQShTOFKDpLD3xus2CWc7VymXOza7QJz8U5tlMTgs9brjdqObBcrqu8aCw6DKRJuL6GA5GJcqZjIvsgAxI6JF5u95Mr9LXuf8Va7F4Gk6wvkhvbo1j+1HfJXFpLOZ2YvLteSRXhuGxdMCPBX0VAxqb7fUwZf2UqJGXjEf7OogQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(50582790962513); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123558025)(20161123562025)(20161123560025)(6072148); SRVR:DM3PR07MB2249; BCL:0; PCL:0; RULEID:; SRVR:DM3PR07MB2249; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 4:2lwPxgP1FDhGT1pZ15+AxKELahsxk6D0D6usVakTSlIfJ+OFWpehpxiE6G8ahQ41jrgdmyoyVcE0PubWfqzLSqT3grA7OeD9nZFFrICxWlXVN6Vw6jVnQdFgQp16blr+Ds1Ox5oBYEi5BCApdiWDhRgnp5b2GIdkcFJpHmOHNC5wTNHuSroWREfJ83CNBfxkV/FH/Bt/TmnLo9KmHR7YoHU0TWdT6nkNpx86iM41vGOK5LoEeckFb2uPcw8urkoYvI+9nkyMtssngPt5CDN7VLiNZ/sMCyqQi6/KJfqznrPpcw0lkgp1+Jg7LdS1mCwXeDlT0sEmGkJF9EjeuL945tT3qKsaUohhEeW56t1Q7s9mtgHoawVpc/o9hpiC3nhoHNADwJAGi4TdX3pomKoOYtM2iO3EFSpszfTO4JfSowpY4pfext3XOja54QaUuCcB2t7TFNPM4BhKVS1Hk8jGHrXrBSferBsbTEIyvLNDPicBRuDQioRsXfCeYqfopz2cxH/EMCJncL3pJTR3sgC8hkj+3r0AbESwnFtqx43eltyoob34Bhkist8uZ8mfQIM29bEJTYFWgw0sClzpcd5ptaB673pKlAyIOnKL4b5kcaQUyqVAmF4J23l/nC+jKdk+j1A2Mx7yz2jB62bN4wVWwQ== X-Forefront-PRVS: 0233768B38 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(76506005)(92566002)(50226002)(6496005)(7416002)(54906002)(5660300001)(8676002)(5009440100003)(7736002)(4326008)(81166006)(305945005)(6486002)(66066001)(189998001)(76176999)(48376002)(5003940100001)(42186005)(2906002)(6666003)(2950100002)(6116002)(50466002)(50986999)(36756003)(47776003)(3846002)(33646002)(53936002)(25786008)(38730400002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR07MB2249; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR07MB2249; 23:WbTOF9wwctcMLtDrhI/CeTEvaeyKaIhCEtrwJ8YtK?= =?us-ascii?Q?O4aoMtMAtE9cg4R76aIJ9HU0rhivqQ6APEicefANaQc/SFXOTtm8pr+59olD?= =?us-ascii?Q?pxBPKVGXtrUFbrwWKvjrKEQJM/WrRoqfgM1n3FICSwmWKcJVhtGXXrI2Y0IT?= =?us-ascii?Q?aISYhsdA27gA4QBkkKspbc8fnXvbic+kNvt70NgXBHnN/nieb3gjpqZBOqAX?= =?us-ascii?Q?UgaXo7PUylI7ygBieS8FOkCjW69re78sLpyYsdARh/xpCfaVIwgj8Cw7btlm?= =?us-ascii?Q?mzJAs+UxRj+tNBlMYwes3DIsDGS1f66gh9wd49cpDLL+4FdWNXRKidV5qwtd?= =?us-ascii?Q?xBahI1hLmzgI3OK6I/cfHeBKwjfakx4MC80qCSnvRUUVTPqUlHCcQ5FBnwkw?= =?us-ascii?Q?ppb7dUcEztdXAPh2R0sehRr07TwVgnjD4F+Vd9LSnMSsnT0nQjVq81lsH6CG?= =?us-ascii?Q?8vueuBUyLDpuOcpBLvSZYhZlf58zE1EkqNzVqnyr7Mqwt7+FWqe0Vqdn7BLN?= =?us-ascii?Q?kHTD5ZbHQ4LtRzbKdwvuvkQrE4E+9Uyi5hR1IbJXjN3SEYvsnEEVbF3Lh5dm?= =?us-ascii?Q?jNZyrcYKfZIRDGSNcsFxlP/JAcbqNunQAvggxjfmMokOjjS34s7UCoC9fdrL?= =?us-ascii?Q?CLlPaYzFl4krYtKyozXU9u4iyDn1AFH8Wq/RfRH3atpWwtJSbhmgPHBcdeO9?= =?us-ascii?Q?ROycPP7WGO+XvXu4C+A6m1+02eWVit7pf5DfXdVJueSwNvBtw6ZZtY5jk/Vp?= =?us-ascii?Q?PipqP7eM1hwZAGcKOBvHRCGZuqZ8JWA5nwUDXW9oQ1drQseiQBfPqIEQcZDB?= =?us-ascii?Q?aecs1cqCfz+U8MPHXVUd1UGe2u2jCL2r66ctyYDOlB+ESVSVGLPoZdY7vXex?= =?us-ascii?Q?w8JE7BLsKUihzGvEpMVIUKxc7e7n9jRON4voCAoVLPFf+aaR9l9puLAfG0qV?= =?us-ascii?Q?x0xqf3cbFa6kj5nUvsH1o4F9xINt31OF8lCzDZsnA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 6:TfrHZJf9FM9NeJ8n+61shhH0tT6gEHNyRRMYsjsj6l7ask1ORT1TL7An778HU5Gr38B/0MSErWfV0SbcD+O2WPKdaGY3qwqI9MRzgSyOsxPyR8zsRYNyjwF4PkHCPTqLnD4iwnnw2wmg9MtMpjkeOh+rhAIb5YqAKH9ynd0Y1HcbLzUBgq4/LoEEXN6nQzN4tBuH8R8jCLTZ/+rCKKyfBA3WhfRNuSq0fy+/ljb8tFrlcyaCQaaRZquCIJP5Uyx0xf3+9GgmQVDZT6GSBUrZhUJqw269lfCNrdrerqIlfwWyTOaxO+SAz4DJ+9Dt4RPCyOIQ1ohVxTsYyQJe8Z0+v7p13Dx0I04rUk58R2HFB8E/E6gUf207ts1ldoeI7Ufacmej4E0/1Nx3XhEzHa81zw==; 5:vq6XM+kMoaFHmTuVUAyuybiro5/LqGfAwpwcrYO7gXSWvzt3uoFo6aK+JRHplsLfkqin2gH8w2rT/20CGHb698cw5cbfD1h57SvydUPjQC6urL0oNsk8yyE1bXaJUtdF1HBojyErn8ZvtutoTKpE6JakkBd491Orha00siEliKM=; 24:1QaK32uGAE87HVvfi4wryR1hrH22WJySTftLWStcMiO94OiTcnCItS4K8G36xDttoY8yVTPxQWI7CXDtKmS69NDJ6E0jPxM+U2xCbLZk/wA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2249; 7:wtYhXKQVNXLLWxkFqdUfWex7OYVWyhY0U7uKGCBK8XSTckqZTz32aRz1SgONSZe8AZ2mmi+iRy7qRvM44m+4VIrMm5891kIEI9XdpK9CbNtmZoYc9ga0fpPSGxfnkBC3YjaI93YKX07m3zLqgc765G5B+o1ktEMgvCtsUKjycJatOvyAJdK7qpLKFnkXYljAESOHHwCs7trkxO1qF/uu1MIuMrA9nkDvAOY5nBasDtOxMExBX9AlpJifDPVhWXGfGjHQTkXnJvjqCbnyAXhd8kYQ0GManr/3aU3gjh5GZwKC5ySChMwe50Z31Ha3UaIk6ukaSrDtCfhEeWIHbFZAZg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2017 19:23:10.3176 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2249 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170301_142335_421198_EE0EF221 X-CRM114-Status: GOOD ( 13.24 ) 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 , Bamvor Jian Zhang , 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 ILP32 has context-related structures different from both aarch32 and aarch64/lp64. In this patch compat_arch_ptrace() renamed to compat_a32_ptrace(), and compat_arch_ptrace() only makes choice between compat_a32_ptrace() and new compat_ilp32_ptrace() handler. compat_ilp32_ptrace() calls generic compat_ptrace_request() for all requests except PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, which need special handling. Signed-off-by: Yury Norov Signed-off-by: Bamvor Jian Zhang Signed-off-by: Chengming Zhou --- arch/arm64/kernel/ptrace.c | 65 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 09e30a9..81d23ed 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -764,9 +764,11 @@ static const struct user_regset_view user_aarch64_view = { .regsets = aarch64_regsets, .n = ARRAY_SIZE(aarch64_regsets) }; -#ifdef CONFIG_AARCH32_EL0 +#ifdef CONFIG_COMPAT #include +#endif +#ifdef CONFIG_AARCH32_EL0 enum compat_regset { REGSET_COMPAT_GPR, REGSET_COMPAT_VFP, @@ -1222,7 +1224,7 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, } #endif /* CONFIG_HAVE_HW_BREAKPOINT */ -long compat_arch_ptrace(struct task_struct *child, compat_long_t request, +static long compat_a32_ptrace(struct task_struct *child, compat_long_t request, compat_ulong_t caddr, compat_ulong_t cdata) { unsigned long addr = caddr; @@ -1299,8 +1301,67 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, return ret; } + +#else +#define compat_a32_ptrace(child, request, caddr, cdata) (0) #endif /* CONFIG_AARCH32_EL0 */ +#ifdef CONFIG_ARM64_ILP32 +#include + +static long compat_ilp32_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) +{ + sigset_t new_set; + + switch (request) { + case PTRACE_GETSIGMASK: + if (caddr != sizeof(compat_sigset_t)) + return -EINVAL; + + return put_sigset_t((compat_sigset_t __user *) (u64) cdata, + &child->blocked); + + case PTRACE_SETSIGMASK: + if (caddr != sizeof(compat_sigset_t)) + return -EINVAL; + + if (get_sigset_t(&new_set, (compat_sigset_t __user *) (u64) cdata)) + return -EFAULT; + + sigdelsetmask(&new_set, sigmask(SIGKILL)|sigmask(SIGSTOP)); + + /* + * Every thread does recalc_sigpending() after resume, so + * retarget_shared_pending() and recalc_sigpending() are not + * called here. + */ + spin_lock_irq(&child->sighand->siglock); + child->blocked = new_set; + spin_unlock_irq(&child->sighand->siglock); + + return 0; + + default: + return compat_ptrace_request(child, request, caddr, cdata); + } +} + +#else +#define compat_ilp32_ptrace(child, request, caddr, cdata) (0) +#endif + +#ifdef CONFIG_COMPAT +long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) +{ + if (is_a32_compat_task()) + return compat_a32_ptrace(child, request, caddr, cdata); + + return compat_ilp32_ptrace(child, request, caddr, cdata); +} +#endif + const struct user_regset_view *task_user_regset_view(struct task_struct *task) { #ifdef CONFIG_AARCH32_EL0