Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp265479imu; Thu, 8 Nov 2018 01:18:10 -0800 (PST) X-Google-Smtp-Source: AJdET5dRECLwHwQXPIb5Coltuhg/EcjBmRRZeLY3tps4nehQQjUN+lO5L4L7qq8QlIUp0/n4tO3N X-Received: by 2002:a62:2741:: with SMTP id n62-v6mr3858737pfn.138.1541668690526; Thu, 08 Nov 2018 01:18:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541668690; cv=none; d=google.com; s=arc-20160816; b=dVDoKHqGZYK4cQbGIsSldiN9dYBbuDJ01XEqJS4koaCAEsJhT40PTZDDMW3M2nQRYU 2F1aFQ03Te4EhB30103CAnhu5B407MRXGNndWX3V9/+IJS+PuI1NX7ls9J+nufPcTh83 kANO2Ce0sn5lKP3AMFYkISfRxRAOPGd3mWpCtT8kO94cFqtE02gOwUspdjtlwYqrMj6E kyigBDwZaqLCYV4OFX4/dX6koUSKi092Tn5GFAnRvBK3QhbMynVmiEeXOI739Rm0l9Gw HYslQrRr1Kqd+d4ptNNZyK4D0U4/RciN/nBftaTgEotb9doME/vnOLVFV5USf+F4E6hA 4ItA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=b8AATkWAFTkkeumtaLP5IYp6UilGSdbzzprP9A/f6uw=; b=Ol0d2uIQ7NKfMqC/ljlqB6NEJ9nV3hraDTWWYN0ZtK1rWgu6SZs3wJIL31PnLhHMc5 tFJnCG1OQMRKLdjyhL9HhhCwBm/2/4VXQcJtrNW7IM/rNPOXj+SPeGtPp0LR1TZbHVWP y7WGdHwl0RPL1yx+TtCWGsQevLqJZN+IVpnZyKfCB+9CbO7VFzyQEfG/Al6PRdYIY/qq /Qr66w13bvKFH24J0H7H6NT60BJEk4Gg0s02NWtKej7Nz/w3UtndbLp5WD3voiQ9/JuR nDPzsLwGIsqwKtnFomBxrTXvpMro00BctxL7PlVZcxi1HftNbNbXO3VAuejeCt9c8pLi YVrg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4-v6si3770486pls.214.2018.11.08.01.17.55; Thu, 08 Nov 2018 01:18:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbeKHSvS (ORCPT + 99 others); Thu, 8 Nov 2018 13:51:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55306 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbeKHSvR (ORCPT ); Thu, 8 Nov 2018 13:51:17 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 117C87F3E1; Thu, 8 Nov 2018 09:16:44 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.31]) by smtp.corp.redhat.com (Postfix) with SMTP id 71E216871F; Thu, 8 Nov 2018 09:16:39 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 8 Nov 2018 10:16:43 +0100 (CET) Date: Thu, 8 Nov 2018 10:16:38 +0100 From: Oleg Nesterov To: Elvira Khabirova Cc: Andy Lutomirski , rostedt@goodmis.org, mingo@redhat.com, linux-kernel@vger.kernel.org, ldv@altlinux.org, esyr@redhat.com, luto@kernel.org, strace-devel@lists.strace.io Subject: Re: [RFC PATCH] ptrace: add PTRACE_GET_SYSCALL_INFO request Message-ID: <20181108091638.GA9939@redhat.com> References: <20181107042751.3b519062@akathisia> <20181107112100.GA20419@redhat.com> <3BDB914D-12F3-4703-A033-EBE02226EC45@amacapital.net> <20181107164443.GA8726@redhat.com> <20181107210251.542cf8a1@akathisia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181107210251.542cf8a1@akathisia> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 08 Nov 2018 09:16:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/07, Elvira Khabirova wrote: > > On Wed, 7 Nov 2018 17:44:44 +0100 > Oleg Nesterov wrote: > > > To me PT_IN_SYSCALL_STOP makes no real sense, but I won't argue. > > > > At least I'd ask to not abuse task->ptrace. ptrace_report_syscall() can clear > > ->ptrace_message on exit if we really want PTRACE_GET_SYSCALL_INFO to fail after > > that. > > I really would not like to rely on ->ptrace_message remaining empty; > this looks too fragile. Well. I do not understand why this is fragile. And certainly this is not more fragile than current->ptrace |= PT_IN_SYSCALL_STOP; trace_notify(); current->ptrace &= ~PT_IN_SYSCALL_STOP; simply because both ->ptrace updates are technically wrong. The tracee can race with the exiting tracer which clears ->ptrace. But even if this was correct. This patch manipulates ->ptrace_message anyway, I do not understand why should we abuse ->ptrace too just to for the sanity check in PTRACE_GET_SYSCALL_INFO. Oleg.