Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3171736imu; Fri, 23 Nov 2018 23:15:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/UKD77HT4afSkQes5nWDuMj/Fcc3IRvI6Sz1h2Tfj27PoJXuMxZEmJG2zsHfEtPxGmJY4ma X-Received: by 2002:a63:8043:: with SMTP id j64mr17311030pgd.405.1543043744055; Fri, 23 Nov 2018 23:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543043744; cv=none; d=google.com; s=arc-20160816; b=rOO/2GprwZLhzvLggs50XHaI79882MZxXi8FqUYbUfs8hErisNWJEYVQfR3miEko5j mEKeltdnBsNf1f91l8FBM56YzlvEUPuKK7DDEp/BjwuXhSaiTBsLkDV6Bh1fQQNdSGa9 4hvaOmZ0YNFRXdVcawR1csWFWM+PFcviOyD9pRnal8Sr3ChsdwZrVJ8DQ+hNonn4XAjJ OzSey16lEwsi4YQG63z+eNRz/aFYPm/+m1bCsWUQWHRml2rO7wpff+51Onj+ioOEgKVy aX5Jl06Z6D8urBzh804DjdgNGQgOCWSpCDS388kVfs4Xq/UKsniLl3rT6LjM1BepzAfa 4FQw== 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=UTYY19CSWWrYt5aBob7By6zAT0h+y85MpDDuuoeExcw=; b=dY8FvY3Jqw4PZe5MY4HG4q0hlm1xZrJ64HeVWvucUjtiulkL2rVAqFsIApk4jcLCaZ JivmLq0P/EQuUsWECvWbWsFRxFM5SLuGL4CvBGZqyb47FMSUlpC+VT1ZfYds9q1sosCZ CVQ1nK8fpwBvMWSCC/QKuteFtTydibU4r+v5Qh5GRz2FsJ3GjoyicCtvCKfpoD8RraMW KNXr1lFe6oIXP7MQ8+PhKdE75KTFDXhBwJ/fsQXqXWT18VbKZgoQ3StjDTT4B63NmzAq unZGAoW7N7cS74evn9f4tkgvZR/aJCPJavJmG1I/ti1Ni2pGozKSNPIO5fZzlf4n1Xvh k1FQ== 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 z66-v6si62371781pfb.104.2018.11.23.23.15.29; Fri, 23 Nov 2018 23:15:44 -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 S2406664AbeKWFzv (ORCPT + 99 others); Fri, 23 Nov 2018 00:55:51 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:33018 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbeKWFzv (ORCPT ); Fri, 23 Nov 2018 00:55:51 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id BD6F772CC61; Thu, 22 Nov 2018 22:15:04 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id AB9ED7CD20A; Thu, 22 Nov 2018 22:15:04 +0300 (MSK) Date: Thu, 22 Nov 2018 22:15:04 +0300 From: "Dmitry V. Levin" To: Andy Lutomirski Cc: Elvira Khabirova , Kees Cook , Linux API , Jann Horn , Oleg Nesterov , Steven Rostedt , Ingo Molnar , LKML , Eugene Syromiatnikov , strace-devel@lists.strace.io Subject: Re: [RFC PATCH v2] ptrace: add PTRACE_GET_SYSCALL_INFO request Message-ID: <20181122191504.GB27204@altlinux.org> References: <20181121165806.07da7c98@akathisia> <20181121235634.GA14146@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 22, 2018 at 06:55:29AM -0800, Andy Lutomirski wrote: > On Wed, Nov 21, 2018 at 3:56 PM Dmitry V. Levin wrote: > > On Wed, Nov 21, 2018 at 02:56:57PM -0800, Andy Lutomirski wrote: > > > Please cc linux-api@vger.kernel.org for future versions. > > > > > > On Wed, Nov 21, 2018 at 7:58 AM Elvira Khabirova wrote: > > > > > > > > struct ptrace_syscall_info { > > > > __u8 op; /* 0 for entry, 1 for exit */ > > > > > > Can you add proper defines, like: > > > > > > #define PTRACE_SYSCALL_ENTRY 0 > > > #define PTRACE_SYSCALL_EXIT 1 > > > #define PTRACE_SYSCALL_SECCOMP 2 > > > > > > and make seccomp work from the start? I'd rather we don't merge an > > > implementation that doesn't work for seccomp and then have to rework > > > it later. > > > > What's the difference between PTRACE_EVENT_SECCOMP and syscall-entry-st= op > > with regards to PTRACE_GET_SYSCALL_INFO request? At least they have the > > same entry_info to return. >=20 > I'm not sure there's any material difference. In that case we don't really need PTRACE_SYSCALL_SECCOMP: op field describes the structure inside the union to use, not the ptrace stop. > > As long as implementation (ab)uses ptrace_message to tell one kind of s= top > > from another, it can distinguish syscall-entry-stop and syscall-exit-st= op > > from each other and from many other kinds of stops, but it cannot > > distinguish PTRACE_EVENT_SECCOMP from e.g. PTRACE_EVENT_EXIT. >=20 > Hmm. PTRACE_GET_SYSCALL_INFO should fail for PTRACE_EVENT_EXIT, I think. Unless we can change PTRACE_EVENT_SECCOMP to set some higher bits of ptrace_message (beyond SECCOMP_RET_DATA) which is very unlikely because it would qualify as an ABI change, this would require an additional field in struct task_struct because ptrace_message wouldn't be enough to distinguish PTRACE_EVENT_SECCOMP from PTRACE_EVENT_EXIT. --=20 ldv --Nq2Wo0NMKNjxTN9z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJb9wA4AAoJEAVFT+BVnCUIVLMP/icSrrhNzO/EyX/hEjQCpTbX OIG34L3Q21JqPle06kSa08WKJ0xsCsOcnnpEqhEOkdgLiYr78im4j0bY+QZEpWRK jNcGizVI7DCuELvY23SspHxSEHkPaTpZZT5YyYhH2q00Jzlq1z4rQsT3MngJt7KC a3W7N/VqyhLASqXUAvxpwBfqzeGb/AoYpsEyON8Yr67MOTeLR3Sh5xY9+NMpMCQx QWexSPWGcsysbY9P4Om2VUjQpdtX41emK9h202PoLyDz4EDOc7RzwoGXPyhD8BAX RzUV+/7va5uvBvzCF8VXGtTbEQ7QJREjjE10T1tUlnbXTvC1pEq5oS0im8MQfITB 6xlBdFB5xCIMyNoY6yQLOb3ZZX27a9M02xrDam21t2OopB4Mvb9ul0T8azX792g1 fvTovioaCgE7ZYf+CN9caNhcJx4BKg2NXb/Y0T+nv2QRc053UgrJSYXnDM8+QIA8 gB4/KSV1wKJLsErmCtDuK6BoWfQSo2mY2CpgxilZKfOYw/EdtPzs7FgbiyEgnZ1Q XpQou0maYn8MXPge1uxerBm4JvXsRm22MvbZe0UZCtmBesvhR2dsyAxpitnkVW6z s+6myE2pFXIZGY2AlrcKa3ffA9GpYBkbMSEHih4moi27f4C5IPPk0nqtB1KiQXu/ qGGm+zLYM3ZbaeyA2qWp =grzk -----END PGP SIGNATURE----- --Nq2Wo0NMKNjxTN9z--