Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp215987imu; Mon, 26 Nov 2018 19:57:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/UMt3jYJ7gk+Gp4ATJ4JfbaitVRFKX4kSCa/V2BQZqSLikrT5UnM+w6yrk9F99bFxMAd8uM X-Received: by 2002:a63:8f45:: with SMTP id r5mr27293268pgn.222.1543291032746; Mon, 26 Nov 2018 19:57:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543291032; cv=none; d=google.com; s=arc-20160816; b=otDudsjt53iroJSN2NalUd7gH7MYJV3hDrDEVRKOGHFENIH1Ot4/vWsXTGP/Odxn3e kK+d5Mz1gRB7X6Sdl6QDVHNioW5Oqc6mCe++EeJ/QmVIjG+IJeJn9wdHrzG/I8jkCMEY +T8iCnH/LEgeYaQZLcMQPrMQV7qiAOtbfSt/PXlqrl2GnmJeSYMevnK2YCMh3icT8Fj1 E3KYvqQaV4hsil4k+oXWOHzRPlRJI9i3pEzgNke0yMumvetmz/G+ImSVYJ7u+z+c3Cg0 HMhd3/5tzXxEb7Sx+J8DSA0TeDv/MmuNBSLGqkP2vBJexM8U1I8U9b2peqXt+hSqdDkB AC+A== 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:message-id:subject:cc:to:from:date; bh=RYLgFw0N0T7LRRqxzyx4g3prLHH74zsftC1Me9WEeLE=; b=a0xVtWXC8NVSWiTD1m65KoK7DCiT3+ZGfxU8u6d5kxcbP8HX0NV6fTZ/NHEJymxrPc cXZoIYAlJOBq/1o87FFNYId67VlJt+hsOsgvQr6jaqoioE1kyT9cwQZMcuR8ttMWO3Ks DeFIcFfF9RmzOU0PSdJnnZCHcdfuoBqxbFbSvWeJv9dARPL99JONYyyynktCpjjHpxdL CcTvDMxgXCZV/vFK9bihBbuGiv6vFf+Dep/gFWeij6o2kkSzvFQMSGgNbY9JuYlsY5dr zz+d1iJWYd7eZHjXEhxSQpduAOkMN8ndgrptP8zp17CoEe8/kw0HDQ80oq0rFCWBCkb5 JpYQ== 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 e4si2330730pgd.256.2018.11.26.19.56.57; Mon, 26 Nov 2018 19:57:12 -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 S1728220AbeK0ORg (ORCPT + 99 others); Tue, 27 Nov 2018 09:17:36 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:35470 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728129AbeK0ORg (ORCPT ); Tue, 27 Nov 2018 09:17:36 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 1E84172CC59; Tue, 27 Nov 2018 06:21:09 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 09D287CD0D7; Tue, 27 Nov 2018 06:21:09 +0300 (MSK) Date: Tue, 27 Nov 2018 06:21:09 +0300 From: "Dmitry V. Levin" To: Elvira Khabirova , Oleg Nesterov Cc: Steven Rostedt , Ingo Molnar , Andy Lutomirski , Eugene Syromyatnikov , linux-kernel@vger.kernel.org, strace-devel@lists.strace.io, linux-api@vger.kernel.org Subject: Re: [RFC PATCH RESEND v3 3/3] ptrace: add PTRACE_EVENT_SECCOMP support to PTRACE_GET_SYSCALL_INFO Message-ID: <20181127032108.GA4154@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <20181127040732.1c9f7965@akathisia> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 27, 2018 at 04:07:32AM +0100, Elvira Khabirova wrote: > On Mon, 26 Nov 2018 15:35:24 +0100, Oleg Nesterov wrote: > > On 11/25, Elvira Khabirova wrote: > > > > > > Extend PTRACE_GET_SYSCALL_INFO to support PTRACE_EVENT_SECCOMP stops. > > > The information returned is the same as for syscall-enter-stops. =20 > >=20 > > Oh, this is not nice ;) there must be a better option, I hope... Plus > >=20 > > Can't ptrace_get_syscall() check > >=20 > > child->exit_code =3D=3D (PTRACE_EVENT_SECCOMP << 8) | SIGTRAP; > >=20 > > to detect the PTRACE_EVENT_SECCOMP case? >=20 > Nope; looks like exit_code is zeroed after wait(). It's explicitly reset to zero in wait_task_stopped() unless WNOWAIT wait option is set. When strace requests PTRACE_GET_SYSCALL_INFO after wait4(), child->exit_code is already set to zero. --=20 ldv --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJb/LgkAAoJEAVFT+BVnCUIKhoP/i5BX4tsokC30O4I3zGET2SV 7GDu6jbhCAYRFoXe7xNoRPQvSh8gfAziWHb6IExqHxdrqf7kj8jjrQS/bNGN/X/h FBRNUJrRcXVKgQagnSIU1jJ30W8WtdDz5C21O7IF9MOSouqqLNvmsKxpPmLap472 1xp7cYszGVKw0KBc8MVCazWc+YjdTP1ws9Gfc2MfOmlZ3RVq4eEkBTylmKc5fo+X UbZCp04VdN2QrdlpPNQZlyjz/Fyz1gC70Sr+hsQKh2P4ZQhBq4/p511J115l52+y +/5bzT17NdTKRrt5R9UhXSyKiPT+24Sar5SyvCRXAdFbtcZHZk0AzbC9kExa1P+a I0kN2YPdOlUckpKV5LX63dgQfDtSGWit46dSqHJcG9dSI2lF3kTnbpDOS13tdlsd a+LobSdZUuVnAujQ+uouYF5+i6xtoj4AANEzhUk0w5xTwMG3gDzItiiVdjGukf4z UHcLgaRAK8TOpm5fXpB3zzqzaza12f10EHFCK+YZQNBUlzS2x6QcDnsbc/Mfhzbz /ph9RgedCKK2q1r1Ctz4Mr5lln5J4bQWIpf2tejraiPe/Nk3Vz6jEYUGpsTBcSWd CndSGYHcXxXwmR8Bi39mT6isn6NSWYUOkM6oTI4KN4n9cSbGWY3tLVtxkL/yUQcP hRzqjz5vbmXEbhytAi1V =dIFr -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--