From patchwork Sat Aug 13 14:52:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9278427 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 761256075D for ; Sat, 13 Aug 2016 14:55:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6403628A9C for ; Sat, 13 Aug 2016 14:55:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57E3828AA6; Sat, 13 Aug 2016 14:55:47 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 74F0128A9C for ; Sat, 13 Aug 2016 14:55:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bYaJA-0004yu-Kd; Sat, 13 Aug 2016 14:53:08 +0000 Received: from mail-co1nam03on0043.outbound.protection.outlook.com ([104.47.40.43] helo=NAM03-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bYaJ4-0004x2-FP for linux-arm-kernel@lists.infradead.org; Sat, 13 Aug 2016 14:53:04 +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=frHhZtLed0qMmdmXKhB6CRP0/L0pSmckb0sIuYzaU18=; b=FzKErAbiFMa/0biYLHOedUNRCouc+aIU9W3kHn9tDPRgU0bAL307GwhPY+8z7ffNLZINNRAJ77uL2wRe5n/wY7stLrJPgDuk/7gT5GGW6Yv1J19O3t2eWIORYhE5wcBgIkrUEGITb4glcMyp+EqD8VdZ+oQaSAND1rSHnc21ATs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (95.143.213.121) by SN1PR07MB2254.namprd07.prod.outlook.com (10.164.47.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Sat, 13 Aug 2016 14:52:38 +0000 Date: Sat, 13 Aug 2016 17:52:28 +0300 From: Yury Norov To: zhouchengming Subject: Re: [PATCH] ilp32: fix {GET,SET}SIGMASK request for ptrace Message-ID: <20160813145228.GA24335@yury-N73SV> References: <1466207668-10549-1-git-send-email-ynorov@caviumnetworks.com> <1466207668-10549-13-git-send-email-ynorov@caviumnetworks.com> <5770B041.3040509@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5770B041.3040509@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [95.143.213.121] X-ClientProxiedBy: AMSPR04CA0043.eurprd04.prod.outlook.com (10.242.87.161) To SN1PR07MB2254.namprd07.prod.outlook.com (10.164.47.148) X-MS-Office365-Filtering-Correlation-Id: 379f60dd-364f-4255-e2ef-08d3c3897885 X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 2:cg0ey5jUez2PeTWMBic4bgImoL58IhSgSaL+8WdnP7uzU0E8oRLyCI6XlGeXFkZwV/SCqir6vGyWBn3sD5fwbPZJ2gswxFroAAfI1StCP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brd0NG4aRcPp5ycgdXrNzyCMMD7xlbUqK+jkaT7yzf89QdBP32dsEUpjaMCkugs77q2VdhUFs1u1MbXF1TC1XdCZuEakNdQal+7RfrlGDVY31HHrs5U+Uvp+Y55rma5wYrNH0ucIaNJ+cE7Io7PMu0Pr9iBYoBYFQvrv8ZeG9hhoYzUPvMtfUoaueIyzlQmZCe4yYkwIHh0p/Ee6zMkR3xIkmAmiFL511gKXu5FuiNtMrmUL/yS2DPSjqa2eUIDJFn8CoYFh83gj1hH2hY+iaf17XlBnErbEwk1Vd7WBx8DlJGsoA/7ukmBA6KX5oIx+NIOEbRAicKn19LKQ0/CbZC1iFCR28dOX9ueZktcFePmPcM9i/oY9TdcuJBulBtmeyZqHN90HDTmCzLyG2R1iV5wIC6M85ex1Yj7Ewzrxv6t7z+Z/DITEWMcGxDg2NuaukYWWm68Ni+zipQk/7gjdL6YBrnHmc5cZ8LlDc2DBp7BhQ5sl9+Z4lL2gXGTVxcuDWWfLuSV2ReKxg0Tw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(166708455590820); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:SN1PR07MB2254; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2254; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 4:vE8Bl1r9dPO6takSObax9wkLsyrF2ee2LiF9Clu/d7oZtuVCmGY6LudoQt/nXfE3XWGtjF5KYdmWQqrmTxwrYkLusR+pRfVU8eKOe6cslvFefcuuf91oRIpfRXeHebJ7j70jWWoF0Ga/R7WRXDm8wt3e6GrpCjqg2CyYD+9Y8Cj8jFrj/k8sT3gDjzVvNNyH4ppmjdp3NBTTExPaDpMBzQdS/nCzaw12WAPBXKDi4vJJCIggU0vHY8I0Pyzys0htsXUdLtObrAGkaf75KCnWocPmeHBHGIYm7w8fugMmAHuz9Bdg16Bssn+IvDzgIiKYeIQixhptZyWRVuBRcBw03kAwANCGgR44V16azeJdKtWWxkPC8286WyO9PernGqmqN/NW05CKZ/AlQBFgTcQANybzxjgOUGTbN97i+EWTges+Jt25Pm6hlKJDm0gSEncEPiTT5XfcgFYJuF9sgnFo1kb5ddT3WLnWzzTXocAG0Cu6obOP9Sg7yKhI/WWp9k9g X-Forefront-PRVS: 0033AAD26D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(24454002)(575784001)(68736007)(2906002)(4001350100001)(97736004)(47776003)(106356001)(105586002)(9686002)(92566002)(110136002)(76506005)(3846002)(6116002)(77096005)(15975445007)(66066001)(1076002)(7846002)(97756001)(33716001)(2950100001)(76176999)(54356999)(23726003)(46406003)(101416001)(50986999)(8676002)(305945005)(19580395003)(7736002)(586003)(7416002)(81156014)(81166006)(19580405001)(33656002)(50466002)(42186005)(4326007)(189998001)(83506001)(18370500001)(142933001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2254; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2254; 23:ZEb2VpkR4GpyZ6qEso1mrYP4TZjqf4qG14HfuX5VP?= =?us-ascii?Q?YpaX+l6LTF8f4nrKODtHC6lUli4WzACwGLAwVhUWIMM5LK1Setb/ErcfrWZ+?= =?us-ascii?Q?NwBRR+sFvi8o+MZRoA5DS70ABP901stBUVa8Xw4xGoGsKpDrr3NJu4VsVv/g?= =?us-ascii?Q?rA6QXV5cwnPrCfidDnK7RitjVaAgtsXH4E86ixlVgBqgMi5xNZcDEXMWdqY4?= =?us-ascii?Q?myzHm4gcHZoeruj75/0FwpbmcabdMY9TBid1U2ARNW7wq7s9RrGD+Q+pskC5?= =?us-ascii?Q?/k3A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us-ascii?Q?O6a9z9wJsODrpJYfl7Q9Bv+1NjqKBOilN1+IcA7z2HSZ0TcyakdWMNT14yx0?= =?us-ascii?Q?Y9VUfQ1OkSVQ3SJktny2e3Aya/KlaUBk6fD3YRDsaluiErN0Kp9rayftEhWJ?= =?us-ascii?B?dz09?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2254; 6:bWpuswZA45U6bTeTY27iJjracNo9Pv31ei0rJUPpGIC0uNWJrYun2/c7mIECDv0V7iOGIIg2WMPtTH8GPlbZHV1zH12ipewDFAjchNYkvBvEvbRX1dtAS4QKdPeRaqHOVhqyxfX0Ywa/m7stq27Wy53Kfu2OBJEfoPCM1vgQM7iC3vip3DYnEfAlBcOP8ejk/Pe3PsvoMmP2hVERQa9caSkOGv5gTiDvJ6wKsHYEpEmA96Yu4cW0SmOXBacufGat2NZGX06ARxF1tqXH8J48c60kIgzSHeeo6EqZIpHqAFc=; 5:cTLB5bMz1L8jFaXCZIQL0fXyPDSrVwOoZK7MVaDoWqhTh9IcL9cvLcpNcFCnUUORAtk3v37AOozLVi/FfC30K4wWjP5WiVciLCT35Myr4TneoN1hLolBllTttrONx+12EN9FRxkjh7M0XrySvct2ow==; 24:IRx+y50fnO8uJSAJS8+SngxnqkIog7ZgPqcLYi7LzvMEfOVC0I/uADKKHaw9a4CgSskb2udEcKaJ+ZXO+gQm4ROB1y35C7oNVfzuT4NQoyo=; 7:j4nh7X3PKjr250LzzIRan3x+boeEWnna+P/t2dv5W7fhxY7gtHevNpiBtUQVrODhq2aanyikAWGrG+WQszF11GsnFwYte4hcVv5u+2n7zds/XINE+O9cCHRudHnxDL0/gVk/GFicKabVZMJ+QCkZ16c6lt/Cs6WdGHEExoWpXARovVUU3yLZz6DO7BkQjfJgTPTjz0gYbiMPBiBCS8dD20C7eLfukXpWKDXVOsKCDlje/E4rzDvq05x9mIGAvT2b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2016 14:52:38.5756 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2254 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160813_075302_720452_A96AFADF X-CRM114-Status: GOOD ( 16.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, szabolcs.nagy@arm.com, catalin.marinas@arm.com, heiko.carstens@de.ibm.com, philipp.tomsich@theobroma-systems.com, joseph@codesourcery.com, linux-arch@vger.kernel.org, Prasun.Kapoor@caviumnetworks.com, agraf@suse.de, geert@linux-m68k.org, kilobyte@angband.pl, manuel.montezelo@gmail.com, arnd@arndb.de, pinskia@gmail.com, linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, bamvor.zhangjian@huawei.com, linux-arm-kernel@lists.infradead.org, maxim.kuvyrkov@linaro.org, libc-alpha@sourceware.org, Nathan_Lynch@mentor.com, linux-kernel@vger.kernel.org, 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 On Mon, Jun 27, 2016 at 12:49:05PM +0800, zhouchengming wrote: > The function compat_ptrace_request(used by ilp32) don't handle > {GET,SET}SIGMASK request, so it will be handled by ptrace_request. > But it's wrong because the compat_sigset_t of ilp32 differs from > the sigset_t of aarch64. The patch fixes it. Hi Zhou, all, Reviewing your patch I found that we have 2 identical declarations of put_sigset_t() and get_sigset_t(). So I moved it under arch/arm64/include/asm/signal32_common.h I also reworked related code to remove unneeded function and variable declarations. With all that your patch is looking like below. You can try latest series here: https://github.com/norov/linux/tree/ilp32-4.8 It's based on v4.8, and addresses some comments. I'm going to meld this patch with current patchset as it basicly the bugfux and update submission when I'll finish with all comments. Yury. From 6a023da977713e9eade0a404c4f000d432d1fd67 Mon Sep 17 00:00:00 2001 From: Yury Norov Date: Sat, 13 Aug 2016 17:36:59 +0300 Subject: [PATCH] aaa Signed-off-by: Yury Norov --- arch/arm64/include/asm/signal32.h | 3 ++ arch/arm64/include/asm/signal32_common.h | 3 ++ arch/arm64/include/asm/signal_ilp32.h | 4 +++ arch/arm64/kernel/ptrace.c | 47 ++++++++++++++++++++++++++++++-- arch/arm64/kernel/signal32.c | 22 --------------- arch/arm64/kernel/signal32_common.c | 21 ++++++++++++++ arch/arm64/kernel/signal_ilp32.c | 25 +---------------- 7 files changed, 76 insertions(+), 49 deletions(-) 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 index b4f2099..e3e2d01 100644 --- a/arch/arm64/include/asm/signal32_common.h +++ b/arch/arm64/include/asm/signal32_common.h @@ -19,6 +19,9 @@ 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/include/asm/signal_ilp32.h b/arch/arm64/include/asm/signal_ilp32.h index 30eff23..3c6d737 100644 --- a/arch/arm64/include/asm/signal_ilp32.h +++ b/arch/arm64/include/asm/signal_ilp32.h @@ -11,6 +11,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + +#include +#include + #ifndef __ASM_SIGNAL_ILP32_H #define __ASM_SIGNAL_ILP32_H diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index e69c79a..4f0df07 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -1332,15 +1333,55 @@ COMPAT_SYSCALL_DEFINE4(aarch32_ptrace, compat_long_t, request, compat_long_t, pi #endif /* CONFIG_AARCH32_EL0 */ -#ifdef CONFIG_COMPAT +#ifdef CONFIG_ARM64_ILP32 long compat_arch_ptrace(struct task_struct *child, compat_long_t request, compat_ulong_t caddr, compat_ulong_t cdata) { - return compat_ptrace_request(child, request, caddr, 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); + } } -#endif /* CONFIG_COMPAT */ +#elif defined (CONFIG_COMPAT) + +long compat_arch_ptrace(struct task_struct *child, compat_long_t request, + compat_ulong_t caddr, compat_ulong_t cdata) +{ + return 0; +} + +#endif const struct user_regset_view *task_user_regset_view(struct task_struct *task) { diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index b103af3..f2c1a38 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c @@ -103,28 +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; -} - /* * VFP save/restore code. * diff --git a/arch/arm64/kernel/signal32_common.c b/arch/arm64/kernel/signal32_common.c index 8fbb609..4a45aa6 100644 --- a/arch/arm64/kernel/signal32_common.c +++ b/arch/arm64/kernel/signal32_common.c @@ -28,6 +28,27 @@ #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; diff --git a/arch/arm64/kernel/signal_ilp32.c b/arch/arm64/kernel/signal_ilp32.c index 8ca64b9..7cc9122 100644 --- a/arch/arm64/kernel/signal_ilp32.c +++ b/arch/arm64/kernel/signal_ilp32.c @@ -26,8 +26,7 @@ #include #include -#include -#include +#include #include #include #include @@ -58,28 +57,6 @@ struct ilp32_rt_sigframe { struct ilp32_sigframe sig; }; -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; -} - static int restore_ilp32_sigframe(struct pt_regs *regs, struct ilp32_sigframe __user *sf) {