Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205AbdGEUe1 (ORCPT ); Wed, 5 Jul 2017 16:34:27 -0400 Received: from mail-eopbgr10109.outbound.protection.outlook.com ([40.107.1.109]:26064 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752458AbdGEUeZ (ORCPT ); Wed, 5 Jul 2017 16:34:25 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=avagin@virtuozzo.com; Date: Wed, 5 Jul 2017 13:34:05 -0700 From: Andrei Vagin To: James Morse Cc: linux-kernel@vger.kernel.org, Oleg Nesterov , Roland McGrath , linuxppc-dev@lists.ozlabs.org, Zhou Chengming , Yury Norov , Andrey Vagin Subject: Re: [PATCH] ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers Message-ID: <20170705203403.GA14320@outlook.office365.com> References: <20170629162637.10676-1-james.morse@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20170629162637.10676-1-james.morse@arm.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Originating-IP: [65.152.152.74] X-ClientProxiedBy: MWHPR11CA0018.namprd11.prod.outlook.com (2603:10b6:301:1::28) To DB5PR08MB0742.eurprd08.prod.outlook.com (2a01:111:e400:599c::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d380379-5532-4d0f-09d6-08d4c3e534dd 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:DB5PR08MB0742; X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0742;3:WnwZiiZsuI0oWWpltj/aIIGX9+GJb3fcHeq7p2Ao8dqXyeoMTkyM5/mqRftkSgPesz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8YfPaM/mtZE0SpNlBHhVROn0ZPyaCWE9B6BeV5chSzdT7VQmcwDrne88ROnjqvDnv2y8pVU2dHKeNz7n/gKn4Q3dpx4D2JYUAHrKMacjITpE17rWXwkdnMEWqgN/7rBACXtoe9hihYKWNgfGTQUn8zB3pafl0ihBOIKgysYKuOCTbcL6/c+1QPEitN2I8yDCW8hFw5zvyCY/l5c5g6uHOruS/klR/KWL8I5s4HDpyAcZ/TvD4AV4IIA21tbxMoNDgzCdXnvsOKSrw+su4eDp3bzGE= X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0742;20:H4MRGJmb8viWSGAseJ482zV5K24Ln7ds1NcGVQQoLjtQdazIEBXHVbt3o37IAo2F/4055qpUw+Ru97CsQlVqMOB0FbnsEfSAFZHM3NIdldTLcXL1OoJM6uerjUvz4up5ia1JOvjCni4Kd3iiZhSk326xq9a+vy63NWUgjDkxUopPvQ/Nx/tPxZ8tErc/DVqg/Px479pbPREKTNWCt/bUZZChTTeOgG124WpZ0xu+wLrd4PqODi/5o3z+G4lh6zS3ExlCqlkbpO77WUXXn2PxO2Be9n5Opaiij6YIumBlh+G+FMAdXJj3fAGILr5mpvhgE03Oba8eChnh5vwWAenXVlL6ys762NqvVovwzmY65KPWyVmvW2MqHZM12+80MXSRc62i0lHxTpTn4r+DSZmAOdkIxGJcBqvMXiIYG3Knsqg= 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)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DB5PR08MB0742;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DB5PR08MB0742; X-Microsoft-Exchange-Diagnostics: =?koi8-r?Q?1;DB5PR08MB0742;4:e81MKmcCWGV35JcmbDpQGF+tCgybh1dLAIq+p1dCgIsv?= =?koi8-r?Q?/YyNcjMZxjYKv5S+IsDZaAnyl9JLgJMTztj7hShGKnO1duL5viM6+1kl7ITC1T?= =?koi8-r?Q?4fnGOO1vUNbSIBGrSiD3/QTkyJazFcQSR2ux+jq8u1/bL5f3S0naefh72xWG+V?= =?koi8-r?Q?X9MFQAfKtgzfj2JDKXiEw9xZHAwqK0IbHBq6sMIC3LDYEiLBPgMk2TL8uHJnKU?= =?koi8-r?Q?h3gtHTGfZ1Bc3WiELV5wKz7JXS8UwlqhUZ3yrKwzEqCmQLgcV4a0IRjQiI/BFo?= =?koi8-r?Q?ISSIwpKJmgSUkj0KLcPTU55VpfV4ZGrYsm+NmE6nTQyjQIWhxOlRQEoEjgaOSM?= =?koi8-r?Q?2qV8Jx0ktXSsIQ0MQb/yVMKiAuiihRIYdOfXTKdSplJw4/DFWjfUMI6hEYfuUI?= =?koi8-r?Q?kA3OZJQwV529B19DF4riB7tgiMd3k6BKppbxK8GzOzlFjhnf67UuBf0Fj4H++U?= =?koi8-r?Q?vM4vkOBFSmyyls4lfpWi+o6i7fr4G0qp44rnWfbtl6Vc7M/jdZIf/mbOc1Se9J?= =?koi8-r?Q?dJP5/ETs6d8Uk5yfvtcTIu6+NRGu3aBU0f0Nq9Rm4HjSGqVs1/EVuSFMtE19Zl?= =?koi8-r?Q?9f+0II4kcOkP5nhOxvh/BUpgre4pmchyPAMY0BlunhSco5qWXkxcZbO5glt+hR?= =?koi8-r?Q?XecsIOdCSP+LTwY6TppEIaYq382IVYR32MKdRvvs9hbo/vbpbMU6Mvl97BRu60?= =?koi8-r?Q?eGeOB9vSGgwoz8vGk++2NJ4UXERkMoZAgvFIuRUOjb6iRR4EkEzUWjxpc4JqkI?= =?koi8-r?Q?WgqBYWwrU0kbZCP+v6mP9Nwgkx8N6c7Og7IkpbVE8lZAdzMSEAftAuFwTHUxBe?= =?koi8-r?Q?xkBrvl1ygck+G8li/T284an7kVYpum8Jw7YJXj054/FGfmn1CVwsD3uZQFQH2T?= =?koi8-r?Q?7uIPzpWdNZLQLHNP2XMwp8/YHn8ILwKjdtgMH/2i2eeCY4FX/i2WWTj4PEKU0l?= =?koi8-r?Q?5lGyaLKHXsXt3VSVj41OXpjl/hDMxetuUMSs6ChWwz/m0kGEfYAdiQ4obBP005?= =?koi8-r?Q?BuMpFV8lD3VF0Bpax36XbbhVJ+r7GRzfGsnoWv0hHw89K1LxThPXo9WPqHpRDH?= =?koi8-r?Q?DlX+OoX2ogS7eLC7vOSxfOeMSRfToH13txypcSbc5WNxWiEvgAicBu2iWC0n43?= =?koi8-r?Q?uRhTxigFPBcUUkP6l8DBJuF2FnPQ9SnHon8s11PecAVZ4p7FKgOoHW7SFaGyAW?= =?koi8-r?Q?EsRRkrDkNavR+vFJ77yeEGLx75xS5r22hE8uKCySrgXiaKmEZX7k/JGe0eQvTj?= =?koi8-r?Q?LGZvtyXnAOWl/1w23A=3D=3D?= X-Forefront-PRVS: 0359162B6D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39840400002)(39450400003)(24454002)(4326008)(23686003)(83506001)(55016002)(25786009)(107886003)(110136004)(6306002)(6246003)(9686003)(229853002)(38730400002)(53936002)(6506006)(305945005)(54906002)(5660300001)(47776003)(66066001)(33656002)(7736002)(86362001)(6116002)(2906002)(478600001)(8676002)(81166006)(54356999)(966005)(76176999)(189998001)(4001350100001)(1076002)(68736007)(6916009)(50466002)(2950100002)(42186005)(6666003)(3846002)(50986999)(53416004)(18370500001)(142933001);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR08MB0742;H:outlook.office365.com;FPR:;SPF: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P0U59oJ/BvwHGS7mHCzbcIHJbPprdy4gU29rN9spTMWakyfTyZfoQKFaO9CvKnktjBR8WJ2EmVZF40QHJpcinvsd8xvCgpZ5PWTCdmEu6sHlw= X-Microsoft-Exchange-Diagnostics: 1;DB5PR08MB0742;20:2HWbPK5R0HFluwxPyBmZvdsvh75nCETWZAiPOEkR2l/d/so2uOcXpIYTOZBSaTKxT4n/g4u2PUoECR6EtRKlyVH84TmOwpTE/QJctWb7/EZJ6vu3IBEPO+YLL4myyO577RZlgOhzHxm5BXxvxb3XXsYLqGxahqnt7fD7DYgT8Gg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2017 20:34:15.3535 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB0742 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3918 Lines: 121 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. > Acked-by: Andrei Vagin > 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 >