Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp706804imu; Fri, 7 Dec 2018 07:43:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wizl0GSL0/1vhZFdWVpY+iqq3bzkGaoONGgc60UTOq/egym9BuawMdtzN0YsDoBLPry/5S X-Received: by 2002:a63:5320:: with SMTP id h32mr2387896pgb.414.1544197431628; Fri, 07 Dec 2018 07:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544197431; cv=none; d=google.com; s=arc-20160816; b=yWt9BQ+RCktSoajqlD4J6rKdgc8BomcXF+LEDZLCKFftyTfnscV+QCgN7H/zrXyp3a fdCJBNGr12lH7LBpDUSCvZZh+dXsYBsT2vp2kzzMg748E9ptkduFJw64K9SpFQrj5vDj y4ZzRs5lVmnKo26mh6rKz8j29EQxkILbS13e1dGZANa9QdUapLmKAxDUf2tNGidgu9EK 3uNJOfucckkqfXzTBA636xdWmXexkF4comZMB+/KRz2cQUrUqVTibMKvNaePmAaV7aZj IMfaWLowiK4uFs7LCW0vwD4m36lL61TC37UQtj3pE9km++z1IUYsRAiVWEWLTKjf9yjP movw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=8yH5YsFWfOzjElLFg8vZs7t9sqGutVI+XHdBvwG4oes=; b=sdaNM3ITpHr3wfQisMynbsOfCdK0S3s5UDeyJLiRAEzKjNE8IraOUiXefzvtfSEERF 2PY54Ul2HWZY5xhNLforoF7c3yfAeg3dSAcWPQDillTUdzpQMIY5omPKHkFg2oo8F8Ne 8lWCozfO8Zd8p1J7pm7tXoo9zDFm5woE0RiYA1ALnrNDrZdHoPE6bwcSvXHEQfDRZrPP uMX/GMX4Ywf4S09KZFzffmnp0eAn6ZuFXF+aKdQAVDxccYXTwbRralfByt4y8ex+AZuQ nxxvTmq1kirO34lhcbyQtiEkNq7p13UcTyF6NdG9zC48+1uaYP8C6p74VS9xJrEUIRHj kKHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s38si2844801pga.38.2018.12.07.07.43.34; Fri, 07 Dec 2018 07:43:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726067AbeLGPm7 (ORCPT + 99 others); Fri, 7 Dec 2018 10:42:59 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:53606 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbeLGPm7 (ORCPT ); Fri, 7 Dec 2018 10:42:59 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id A590772CC59; Fri, 7 Dec 2018 18:42:55 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 972197CE9E5; Fri, 7 Dec 2018 18:42:55 +0300 (MSK) Date: Fri, 7 Dec 2018 18:42:55 +0300 From: "Dmitry V. Levin" To: Michael Ellerman Cc: Benjamin Herrenschmidt , Paul Mackerras , Oleg Nesterov , Breno Leitao , Andy Lutomirski , Eugene Syromyatnikov , Elvira Khabirova , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call Message-ID: <20181207154255.GA28964@altlinux.org> References: <20181116121701.14359da0@akathisia> <87ftw12nyn.fsf@concordia.ellerman.id.au> <20181119210139.GA8360@altlinux.org> <87efbe166y.fsf@concordia.ellerman.id.au> <20181203031823.GE11573@altlinux.org> <20181207011946.GA18558@altlinux.org> <87y391k2tq.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <87y391k2tq.fsf@concordia.ellerman.id.au> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 07, 2018 at 10:12:49PM +1100, Michael Ellerman wrote: > "Dmitry V. Levin" writes: > > On Mon, Dec 03, 2018 at 06:18:23AM +0300, Dmitry V. Levin wrote: > >> From: Elvira Khabirova > >>=20 > >> Arch code should use tracehook_*() helpers, as documented > >> in include/linux/tracehook.h, > >> ptrace_report_syscall() is not expected to be used outside that file. > >>=20 > >> Co-authored-by: Dmitry V. Levin > >> Fixes: 5521eb4bca2d ("powerpc/ptrace: Add support for PTRACE_SYSEMU") > >> Signed-off-by: Elvira Khabirova > >> Signed-off-by: Dmitry V. Levin > >> --- > >> v4: rewritten to call tracehook_report_syscall_entry() once, compile-t= ested > >> v3: add a descriptive comment > >> v2: explicitly ignore tracehook_report_syscall_entry() return code > >>=20 > >> arch/powerpc/kernel/ptrace.c | 54 +++++++++++++++++++++++------------- > >> 1 file changed, 35 insertions(+), 19 deletions(-) > > > > Sorry, this patch does not work, please ignore it. >=20 > Hmm OK. Why exactly? Unfortunately, I have no idea why it doesn't work. All I can say is it breaks strace because the kernel no longer sends syscall entry stops. > I wrote more or less the same patch, although I used a temporary bool. >=20 > > However, the bug blocks PTRACE_GET_SYSCALL_INFO, so please fix it. >=20 > Sorry, didn't realise it was blocking you. We are changing ptrace_report_syscall signature to implement PTRACE_GET_SYSCALL_INFO, and this is the only place in the kernel besides tracehook_report_syscall_*() that invokes ptrace_report_syscall() directly. > > I'm going to use > > if (tracehook_report_syscall_entry(regs)) > > return -1; > > return -1; > > in the series until you have a better fix. >=20 > Yeah that's fine by me. I could send that to Linus for 4.20 if you want > me to, otherwise I'm fine for you to carry it in your series. Yes, please. I'll send a v5 shortly. --=20 ldv --oyUTqETQ0mS9luUI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJcCpT/AAoJEAVFT+BVnCUIMbMQAL8L5afzlG2FpQERgK3jWn4a Z+3/hu+dsem3sacLEskTymxnyV7lCNvHvz4kcvNB/wfwbbsaEScu4RveZIMq86E3 TCu/kWvfYdrxB/Xux9hoZLyxYG3xhd2Jg8I/4PuHG2p8AeamnykVFqLFXlDxYkJq gLmbjUxA0flkXoL+Ts9WyIA6X5FYxWY2zaiVgwZ52QSZt6JoyfmiMMYsvAolRtPP 1C0pJo1ZbPkBUTRI0FXIbbjik3y5tDX/6grLCcDIMBL8/UYRfFDchHmnBtrAkKk6 L4XzlNX52qWhj7Zlqy5byF1a8Tlyq1GCaXOVl/d7whTDDy96dWWI5HzONhLlU0RD QUfTzthXeReNHBMFPW9w3k+iu9DOmlZSy5q8UBq7m8WlNzSAlxvX5fJaTmJA8E57 uWq1/Sn5abplHuZuom4hourp8+mOxFfL6jyoeraqYTNKgWm+0vIDqw3CU5sERfty f/Fb4OBwzm+VMcuQAa6qO5eQMkN6roaEG4uTS1TpiJNrVJERyUTcIei/q41VPVBU vagvDi4wERzCKWF0oA611+EKb4UGOlZ9+nC9eKOOLEckf5uOdOu8CVwFtiK994s5 vpB7YSejmG85ujZkiAXI11jhOnGZlkmEMRhSk+RyKRTT8PbUurm929qnbdWkuxlU DyJAIAZjeq7+uQSRXS/B =ekme -----END PGP SIGNATURE----- --oyUTqETQ0mS9luUI--