Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4083701imu; Sat, 24 Nov 2018 18:11:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/VSfS/XiXDUsCPV+bxHM51/Ec/QFJZIjAYCyAynuaLH8lc15I4CNR28xDfLxukWfcxd3OvK X-Received: by 2002:a17:902:5a5:: with SMTP id f34mr9125502plf.161.1543111913327; Sat, 24 Nov 2018 18:11:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543111913; cv=none; d=google.com; s=arc-20160816; b=M1RhWxW9l7ISBiaDOBp6ewq4YFDnr9pLXK4r2wMJJYSoM3RNhN3C5+2S8J6yWC+N7o Q6hdDbavRufFPhvcDj6NdW58oVJNKG2vEnS31PZ95z0pI0mo8fOVZdpMDxlCnuyJu78C FRDo/B8hVEozT/3yK8nQYLkXjuHECsabsHX0JaOmTXmDDIyob7S/fAyttvtqdJYd26M0 4FEnz7weu+NQG0EP7zW8HFgxw9OVYl9Yp6NEJkj9nIetDn+WTYypMyNnCR7ajofWzv6q kJW9enDZl9vEqygYuXL4g/3uLjcX/ZgxbIe4kn+voCdtAdPjBgCQh2eYrPHnmp1x9izF KZSQ== 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=vq9D9jTksAilhSiZLQMTedof22r5yEsfOl6o1YVpSy4=; b=m56iANWcYot0i2ZX9B4T1zQvUVW12d9rC8Q5H7u0QBCrPZkLM3sSw3hBIqj57bLcwo bSf05uLTqn04KlW5o/lNMv9xRo8cmrpZAmHKuuZDqPaGf/eksPQTyvKosKt9iTpX9Gjn MNfEO9TNnIC73qU+cRcFOBjDnjVREbGYpSBooHiJY0Ni7i3ge5MIV1CFZ9kmojzV48/M rrWGiXEStq8iCPAlaLUBcWH4C2zWalR9kvgf8QK9NB4yiuSkrFkrwJ1aimCb4tqoPOxM vTN9leK3J1MokfPSpZPY0XdOpNu4s45vR9QFSQzt4fEAm+BsOox56cQzOrJ3ZOt9Zx9B RWBg== 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 4si10409880plc.320.2018.11.24.18.11.38; Sat, 24 Nov 2018 18:11:53 -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 S1727126AbeKYNA5 (ORCPT + 99 others); Sun, 25 Nov 2018 08:00:57 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:52294 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbeKYNA5 (ORCPT ); Sun, 25 Nov 2018 08:00:57 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 40C3372CC61; Sun, 25 Nov 2018 05:10:59 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 27F857CD0D5; Sun, 25 Nov 2018 05:10:59 +0300 (MSK) Date: Sun, 25 Nov 2018 05:10:59 +0300 From: "Dmitry V. Levin" To: Joey Pabalinas Cc: Elvira Khabirova , Oleg Nesterov , Steven Rostedt , Ingo Molnar , Andy Lutomirski , Eugene Syromyatnikov , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, strace-devel@lists.strace.io Subject: Re: [PATCH RESEND v3 1/3] ptrace: pass type of a syscall-stop in ptrace_message Message-ID: <20181125021059.GA1190@altlinux.org> References: <20181125022150.46258a20@akathisia> <20181125022227.55e8caf7@akathisia> <20181125015402.glcaw3kghcu4pr22@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline In-Reply-To: <20181125015402.glcaw3kghcu4pr22@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 24, 2018 at 03:54:02PM -1000, Joey Pabalinas wrote: > On Sun, Nov 25, 2018 at 02:22:27AM +0100, Elvira Khabirova wrote: > > Define two constants, PTRACE_EVENTMSG_SYSCALL_ENTRY and > > PTRACE_EVENTMSG_SYSCALL_EXIT, and place them in ptrace_message > > for the duration of syscall-stops. > > This way ptracers can distinguish syscall-enter-stops > > from syscall-exit-stops using PTRACE_GETEVENTMSG request. >=20 > Is there an advantage to using two constants instead of a single > sys_exit bit (set/unset for syscall-exit-stop/syscall-enter-stop)? Given that without this patch the value returned by PTRACE_GETEVENTMSG during syscall stop is undefined, we need two different ptrace_message values that cannot be set by other ptrace events to enable reliable identification of syscall-enter-stop and syscall-exit-stop in userspace: if we make PTRACE_GETEVENTMSG return 0 or any other value routinely set by other ptrace events, it would be hard for userspace to find out whether the kernel implements new semantics or not. --=20 ldv --jI8keyz6grp/JLjh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJb+gSyAAoJEAVFT+BVnCUI7msP/03Hw0MVgHwFtPiI1I454dg7 cG5xi8aZUwHZM/8tWCiAPtk02ttpXDZR+ReQGMmoRdEBsuvdnhTImGHgU08PjNo/ hR+vTW3cB8hajPBQr2o7+lN2sqRaH/cbaBOdLA31bUz5BNJCrDEASUX64AG8hV5i yk8DeoHLfw9Ub34PtDz3yJWudSc7irQfBGidpiKmskabRNeaZWKumtTUx36jkOg0 oeYrdOVPEawE7nkE9LlmkzUiidZzaj1gd/ObkazJ/NyCPC7GvS4IEzSu59178NlG SMiui9AMQkX/3g6S4hY3DQrice4fdYyi6NNnBXhjoePUOjlwYTw7BSA0yNAYSoat mnMEds03GuaF5T7S5Okdny7ywROMjkj3i+kH3qXupszUPyY3tlHRsqerSQ/xfKoY +lIVYNxrHseIMfIV+3tHP6R4CxYoaUdxSmYcL29un46KUh8E89p3UHEbHivSeHYV qccEUnjy5FFwYu6TxFLhIBtCcMnNHZK+IEm/PwlX7sac5/5NE3cLBiMG6oYjGRcg YzXg3p62Rtrpsd9sVsEtB2fg3wDjsPQIsZSDnksVPYOFwsx+fIOJE8zTcKw1eiW+ W7i4enyWZht6MlIzAoaj4VfVqJ4GM5ZKi/vCyGuIApK/AOZHwPHBhlVotrGcXVq6 o4kgKmniuyFHhcF4armo =SNPL -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--