Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753572AbdGJIb6 (ORCPT ); Mon, 10 Jul 2017 04:31:58 -0400 Received: from mail-bn3nam01on0085.outbound.protection.outlook.com ([104.47.33.85]:1496 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752317AbdGJIb4 (ORCPT ); Mon, 10 Jul 2017 04:31:56 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; Date: Mon, 10 Jul 2017 11:31:26 +0300 From: Yury Norov To: James Morse Cc: linux-kernel@vger.kernel.org, Oleg Nesterov , Roland McGrath , linuxppc-dev@lists.ozlabs.org, Zhou Chengming , Andrey Vagin Subject: Re: [PATCH] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers Message-ID: <20170710083126.pv6pxjrt7qshxsa7@yury-thinkpad> References: <20170629162637.10676-1-james.morse@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170629162637.10676-1-james.morse@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [95.22.236.58] X-ClientProxiedBy: HE1PR0802CA0018.eurprd08.prod.outlook.com (10.172.123.156) To SN1PR0701MB1872.namprd07.prod.outlook.com (10.162.100.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9ede4ec-2ea0-41ac-437a-08d4c76e15b3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN1PR0701MB1872; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1872;3:nXQmIfLtGM0KZNanajWfkYe5oHLu7KYPo48UHvrv/29N3vplzJYJWVF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4draDTE99A1mx8CzuTjkSH7Bkc4I2ZqG5De/1fdejJr3ig7S3gm2yOMEVcRnVLtTckX0EFwuVapWPTufBHshlbFPfnrFxIdjBN65s/q6cCYu9206t6pdpGvdlY/5fod9V5cHPrXDy2bSYysDX+bVUczWRinsxQuiTmOML0B+apWmqczUJV1rc9kVMpu4a+1zXSn8FLHqDfg5E9QtMZxQqeaiuzv1TPUFgTtzFQXPOXdS83A6CnJgjjSZzKBh25LdnoclsYRmBvFl+7WYgMjtF4q7Nz9xih/U3xSUMw== X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1872;20:xMIyLH6UY6G5a6ATg4zQzAqsNmuMAegUjnkzUUzsWMrBZD6V6LOGOh8FST879Wo5HCxwZ8oAbVjVAkHhQ00Tltjidxu0qefkUXTKjaKh8cA7MtUbcaYs39r7t9/j+MkA1gVfgRm0pOq2m7Fz5iqCjkdIkm3AK82vg77QkDgfhQnKANeJ7BtPH8IJ1xXNYIuqE8zOoSyh/Z2Oqny2o4G23vxQhRrX2wtTUoBt10p78jRtQ3oD0unbqDq16TbRdVograf1UV1Y0UmL0IVMgpWV7KRuF4wq3ju1KnET4XgoPNBdcPAHuMLr1aXSto5OWd4ZkhbOrLPjWJr+8DKaBEqX5xS2fqhGeX0Z+vo72zPJHIwcK6vUj65TaVSmxOuLUJuxq9hVIcZeVs6i/sBFudfhkkuN3TTIWPezjh1pWmrT04u9g07Ynm4SzaCciqzHXlJ3MjNYUxxEwfex7rJXpP9V22xTKRRnPRxhTUkUeAFhB2iLbAfWmF6r9X2v9x9OPq3uhy1vn5a7+Nfncteu3y5a205Nw2W8lMNO15fxcjSE0qsPoCissiAFHEmkfeq/QivZfn9+24QH9M2hgzdVDjXNFPR9JUl7wZTUJUSw6g0ywaQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(236129657087228)(50582790962513)(148574349560750); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR0701MB1872;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR0701MB1872; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1872;4:sjnYr+NWNHneAIDIkym+NzJ3vUPBgYqmRckG3R7w?= =?us-ascii?Q?EZEhY5diwBio6x3kXSbKUYgPAhFVkUCJ7L1q62ZKfbqQ6jtDP75uEedOKWGR?= =?us-ascii?Q?X5wEDv2dGuZoeUqNndjjaY/vlvD9H3U/1Be7D2bjNb4GF3BUAQiOoAmh875q?= =?us-ascii?Q?Ij4vZk8wOaKF7U9Dh460byXXR2mq9kELuMlSgrZnE1vO1vLwdibzjI7hRJaL?= =?us-ascii?Q?TXdhD8zySsiGA89xFNu+jZ/jLyDrsiLmGsTNuLjeSQN720zOWgo2TOUc25eb?= =?us-ascii?Q?VGf6+kHK2HHmg/ZiyzzEbaejYwLK2JcMWALaS11vGvVRBuUTgH23nXPE2Cl4?= =?us-ascii?Q?LI+jEarXC6XAm/0/Rg0xNvQL/YA57gbrSvPAAkn/tpxIEqrui3A59t7va4ZB?= =?us-ascii?Q?ien/7JlsZ3NyK054coy1muASN5oGs55qF23Wmc5jIt4r3Z9b4pKOlXJHDZrl?= =?us-ascii?Q?IKSJgOTHqaRMxJ50znYhBL0nmm6djZMDWGgR9TR4CU0UTjLvi7izF5vE85Po?= =?us-ascii?Q?cAMypYvqVBgOrBUg04UK3KYF0DBPIFCp3WhGrb4IR0p907MXmex7lzHsv+X5?= =?us-ascii?Q?H/zoQaLD5Vr+rW/6Vy0fLuVxNu/tvo+bUpnJ9MmIcjw2lOXKIdMGRIp7knGM?= =?us-ascii?Q?MGtGTE+uA5Dt1YsQepnp7M4UzprrYh6dOX+SjV4JrkpH/gDeDkMrGplksFLD?= =?us-ascii?Q?hMSZ+iyKbAHXCdDkJ+ljthO0Et1t7aynDsvyU2TDAWPxmzdpyB2tFV1RI79a?= =?us-ascii?Q?krjqiR1RtYJLe+2VkZCInqJ1IgGUSgySdLkK9rmNdEm4J6EKBKhSZKB+xvQM?= =?us-ascii?Q?7W/qybyrtKuaC6n7GtzQavfdrPzIfP6Ek/7mXOkWdUFUb16Cgkd3wJRRc6dw?= =?us-ascii?Q?D/u2gCWSJNHPV+pEzwbt5ZZEwJX1TK5QE04GElbNmoydjau2yAKKrUv++EmI?= =?us-ascii?Q?6B6nH0oauU02L7m9ufGeA8R4hiI1PRMAseoheQWoRjNpT5y1SD7z7v5rtk0b?= =?us-ascii?Q?qYU079SeEbyeH5T4QmE2UHlpQArSnh9mKS75L+qaeONYsoFCV9INLWrzHCHv?= =?us-ascii?Q?UkNxv+Gb+2+RD0ECfc9Qz690oPJUZE5ZQePZfG9jVchW4aa/nJdLg45UfQU7?= =?us-ascii?Q?BPMeIqqXTfTC9m+vzHBHcaWlZZmPeFvEgQgLmf1iSrna85emuVkEibG9ByDZ?= =?us-ascii?Q?+btJPLnYyCi1gV14//iVVTuEcnUycULbOUSQjLiV0WM7dWsE+7xTgr25bm8Q?= =?us-ascii?Q?kGXrnAOVioepaS22ejYirLtr9Lhe0TU7awGYvZHrt+L7n91Hli1G75xL5Hck?= =?us-ascii?Q?HeuHMB0ScgH3tfELJ4HYNFQ=3D?= X-Forefront-PRVS: 03648EFF89 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(39450400003)(39410400002)(39840400002)(39400400002)(24454002)(7736002)(66066001)(189998001)(4001350100001)(5660300001)(50986999)(76176999)(54356999)(305945005)(1076002)(83506001)(2906002)(8676002)(81166006)(33646002)(47776003)(7350300001)(25786009)(4326008)(6246003)(110136004)(38730400002)(6116002)(229853002)(6916009)(76506005)(3846002)(478600001)(6496005)(42882006)(2950100002)(54906002)(6666003)(53936002)(33716001)(42186005)(966005)(6306002)(72206003)(50466002)(9686003)(6486002)(142933001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB1872;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1872;23:sJJVaoH59HN9fzi8WZWLcUaErFoSbvFPVigP1LS?= =?us-ascii?Q?Lm8FmHPWV+Vj7czCJ1zskubOfb5MCCQos1t4Hie3QmpSsi57nQywpp9k0S7c?= =?us-ascii?Q?ucu2sh+Pd42YQK41GUvqYX7EgzwdnQt32LRBYGAC7GKkj//2cY1uCTBUiYrW?= =?us-ascii?Q?SMsHbutOveXFUb9h6pvrJCdhkX4QIJkB7IgtIXwOz6uEbQH8fhvo2jabQBaB?= =?us-ascii?Q?QbA7QvgflY2AYx0W3AzCK9EKg/4GVXw4GBT2QRI6NN3/V9P/dzgtaCafP3wz?= =?us-ascii?Q?wuvIMrJf6uzJl6ts0ND77qUNr/iXoYW8t6BoVUDZ41+S+nd+uI0xyJWLqyp2?= =?us-ascii?Q?Dw+KQLfqg9oXrGQiBmuIFAw/W13+5ESTdVmip2Lnfk8f+AGrF+W6KZIol+hz?= =?us-ascii?Q?NX/2yH04hm/euBDsA+WDMaQq24qtTUp4Qz/99y4wMJQVs38md0rwOo0XKWc4?= =?us-ascii?Q?fBiqXNdB31J4hzKng4LdtmqapVq2hRMviA3ghaSBVvlRNzDVoypFByVcThBw?= =?us-ascii?Q?Zu+CZYrRoDxJuuwFkQmH4Iu0+KdLHVwHsFNc/WO44xRXmEE0ybr5vhVz22Um?= =?us-ascii?Q?10msEU/TO41WsmkGI+ftR4yuMCo4z/0Xz8wh57UF/P8ksvt+e4IwfUx6KKSa?= =?us-ascii?Q?yDz04Iiww6ZZX5RdtwME6hfxhv3It3Muqf1pcy/eaANxgRVeElUfvIk5BJF3?= =?us-ascii?Q?pToFUS7QBh/17iK31JuS9gf/RFOZhQAlfEmhKPmt7qcvNy7nxGEK0pTNmCSA?= =?us-ascii?Q?JDHmbRfR64SmeLC021doxycOQekf9wqRbxOGRxsk2DIvQjvfuDPP5E2duYW/?= =?us-ascii?Q?1slPb3nCiPrPaZx4Wz+ne4I1iObINr9rPKb/2dyN93GJAa6G83jbrXIulgfW?= =?us-ascii?Q?crm96FxoWQv56tRLmYVeLcIYdvNm2eKTapQf+Cq4eQzMZUK4QMUaPjcHCK8M?= =?us-ascii?Q?7Q7LIh/SDhD1j75+LXOAl7nUDvTECcX1h6OH80UObcbnl4u9PpcS8QNQTdoc?= =?us-ascii?Q?FRl/CB89naXVCkiODciPyq60N9M15++h5MRLLNPNpwK/uSIlgGfTRVcAGK4r?= =?us-ascii?Q?eRFHLWmu2KGVZhcEtmKg2lC1vISIbJqq6cLX/BbtPKvqa0Rrs89jinX7b0xv?= =?us-ascii?Q?6u+/VBeuXq5BhOlOZ5BIApVQ5RQogoqAS1Qs1xaqgMJQgdRKq4u16MT68jY7?= =?us-ascii?Q?gRkiTd/jpLeK+NWFlGDgPb5EhvQqdGVVISpP7TunUPbbZf286LLC1qGKCIsv?= =?us-ascii?Q?4TJhLccNJCaJA7wo0NsQ=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1872;6:/nGUEj7YoSFiSDCP8c5XlsxnUbTSmM18vbkKx7ws?= =?us-ascii?Q?i9lkC/3PqCUBnxYIgNMg43Rf3vnm/cxrmSKvGZkRMtJBI1FeUnQbyWxt4bMA?= =?us-ascii?Q?9N0dMIeaS0Z16ZFAywrcGCpAVdO+fOh3yPmXOdyrtXn8NRd2I5U9xYrmpXYU?= =?us-ascii?Q?ZNTF965NO3eCW/trXgJJ0at5pVRvq9lj2HcYdrk3AEEIlF1c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h623/fgLgvAHi5VgdeGAf9bJTk42THLf94IphU90h1htmq8Af3xzQE21eMw8Q48+fSd6Z+IYqSRrSCEDl7QfBBHPk7RC2n6M8N9eB88PvbNFQu7hpfnRfsrvC/Tk1o+NBMgzJv7/Kg2x+iX+/+/yWm8Ao4R4h3mai997EV7/kcZJFTr0DVw2ME2tNL+pdRkCekGNpE/IeFcWrpwyChzu5fhPN3oYsmEFCZol4nPU044x2TS0O/8Lscb6BL1RThTKBp3yu+1Z608StsNEMUYvfMwVXo9EKAdZFiXp0SIIlWNMhvrcC/cizwC6vyOHTA61e+3E+oMviS1DlXLKX0NYgPwnfLa8VV96OkIN/ec5VFK+2Hy7Ky966WCZOSiE2rq0odTgo= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2017 08:31:38.4232 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1872 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3994 Lines: 125 On Thu, Jun 29, 2017 at 05:26:37PM +0100, James Morse wrote: > compat_ptrace_request() lacks handlers for PTRACE_{G,S}ETSIGMASK, > instead using those in ptrace_request(). The compat variant should > read a compat_sigset_t from userspace instead of ptrace_request()s > sigset_t. > > While compat_sigset_t is the same size as sigset_t, it is defined as > 2xu32, instead of a single u64. On a big-endian CPU this means that > compat_sigset_t is passed to user-space using middle-endianness, > where the least-significant u32 is written most significant byte > first. > > If ptrace_request()s code is used userspace will read the most > significant u32 where it expected the least significant. > > Instead of duplicating ptrace_request()s code as a special case in > the arch code, handle it here. Hi James, I tested arm64/ilp32 on top of, and everything is fine. Yury Acked-by: Yury Norov > CC: Yury Norov > CC: Andrey Vagin > Reported-by: Zhou Chengming > Signed-off-by: James Morse > Fixes: 29000caecbe87 ("ptrace: add ability to get/set signal-blocked mask") > --- > LTP test case here: > https://lists.linux.it/pipermail/ltp/2017-June/004932.html > > kernel/ptrace.c | 52 ++++++++++++++++++++++++++++++++++++++++------------ > 1 file changed, 40 insertions(+), 12 deletions(-) > > diff --git a/kernel/ptrace.c b/kernel/ptrace.c > index 8d2c10714530..a5bebb6713e8 100644 > --- a/kernel/ptrace.c > +++ b/kernel/ptrace.c > @@ -843,6 +843,22 @@ static int ptrace_regset(struct task_struct *task, int req, unsigned int type, > EXPORT_SYMBOL_GPL(task_user_regset_view); > #endif > > +static int ptrace_setsigmask(struct task_struct *child, sigset_t *new_set) > +{ > + 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; > +} > + > int ptrace_request(struct task_struct *child, long request, > unsigned long addr, unsigned long data) > { > @@ -914,18 +930,7 @@ int ptrace_request(struct task_struct *child, long request, > break; > } > > - 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); > - > - ret = 0; > + ret = ptrace_setsigmask(child, &new_set); > break; > } > > @@ -1149,7 +1154,9 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request, > compat_ulong_t addr, compat_ulong_t data) > { > compat_ulong_t __user *datap = compat_ptr(data); > + compat_sigset_t set32; > compat_ulong_t word; > + sigset_t new_set; > siginfo_t siginfo; > int ret; > > @@ -1189,6 +1196,27 @@ int compat_ptrace_request(struct task_struct *child, compat_long_t request, > else > ret = ptrace_setsiginfo(child, &siginfo); > break; > + case PTRACE_GETSIGMASK: > + if (addr != sizeof(compat_sigset_t)) > + return -EINVAL; > + > + sigset_to_compat(&set32, &child->blocked); > + > + if (copy_to_user(datap, &set32, sizeof(set32))) > + return -EFAULT; > + > + ret = 0; > + break; > + case PTRACE_SETSIGMASK: > + if (addr != sizeof(compat_sigset_t)) > + return -EINVAL; > + > + if (copy_from_user(&set32, datap, sizeof(compat_sigset_t))) > + return -EFAULT; > + > + sigset_from_compat(&new_set, &set32); > + ret = ptrace_setsigmask(child, &new_set); > + break; > #ifdef CONFIG_HAVE_ARCH_TRACEHOOK > case PTRACE_GETREGSET: > case PTRACE_SETREGSET: > -- > 2.11.0