Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp676710ybi; Thu, 30 May 2019 05:07:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0MKQOPQuaHiP/21V7OjSg9dNOvV1CD4uFps1uPHxMa2Rzj27oFPAiHgn5SZH2jHRsJZZm X-Received: by 2002:a17:90a:a616:: with SMTP id c22mr3216833pjq.46.1559218048954; Thu, 30 May 2019 05:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559218048; cv=none; d=google.com; s=arc-20160816; b=OBrt6X+Egn235PR3GBdh4X3hQyoxxXUp+5kn60bnVGG3ixE63qiFrLyJOxgMce6iX6 RaaLppgwMgEPYdSSfMSyIa30qewqA1aG9i95KKwYG4ecpRlMHz53ERshh/K2AtiNCP7F 1hKNOCqvgqnBvpyfekPm+HP2KKRfXevPK1sFOxhTk+dMkcbOsD6MzXKuzcRik/bt4Sdr oEaPNEo4q6Y8irb03xDLBGd9U91E8rQErGaRdoCccKhDmfRWRxwYOpAfF5I2zM52BdLh 4ZLgLiP1MjGJ0GHUBQutP3MzVzbvtikZQAIKQJf7cz2Gkj5wC9Aly7rNvfZY5dF5wKbW Z3Gw== 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=3q8DmAqrtGN65Fe3pLuasQZdJHwBALjwuZRaTqJxpPw=; b=w3rBZUEd0TwrKfz42XFRNZbiceFR0wI7e/LvrjOLnTj1U+xgcpI2ib6KByUrxmhGMq afLBhWMpb7Qwaiv5ju+IWQ+s/SAVHHo0z7unN9YbVpX8YuJIGNeNthlouqLRU56Xpxib i0mz6wH9WtIyldSkDNZsFyjEzE3MkpA4/ky5Qses3yYzqc2gkCYeQ4giS2KoPdHba9gl uROGc/onXIbJBvn6cWjdPAWqrh2UMqBLBoPlYyMCxujrSVR2N4sZQUZGAqzlKrhZmZ4q nIXXEjL2nMrfDE86ZRbaV3Zmxrq6ttyrvqnMcS4c45lKLvkF7/s1PxvYQ0qvPwnQcTur D5bQ== 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 a2si1903793pls.118.2019.05.30.05.07.12; Thu, 30 May 2019 05:07:28 -0700 (PDT) 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 S1727201AbfE3MFn (ORCPT + 99 others); Thu, 30 May 2019 08:05:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58876 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbfE3MFn (ORCPT ); Thu, 30 May 2019 08:05:43 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EA1EA0B58; Thu, 30 May 2019 12:05:35 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.159]) by smtp.corp.redhat.com (Postfix) with SMTP id B24C819736; Thu, 30 May 2019 12:05:32 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Thu, 30 May 2019 14:05:34 +0200 (CEST) Date: Thu, 30 May 2019 14:05:31 +0200 From: Oleg Nesterov To: Jann Horn Cc: "Eric W . Biederman" , Andrew Morton , Kees Cook , David Howells , kernel list Subject: Re: [PATCH] ptrace: restore smp_rmb() in __ptrace_may_access() Message-ID: <20190530120531.GE22536@redhat.com> References: <20190529113157.227380-1-jannh@google.com> <20190529162120.GB27659@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 30 May 2019 12:05:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/29, Jann Horn wrote: > > > (I am wondering if smp_acquire__after_ctrl_dep() could be used instead, just to > > make this code look more confusing) > > Uuh, I had no idea that that barrier type exists. The helper isn't > even explicitly mentioned in Documentation/memory-barriers.rst. I > don't really want to use dark magic in the middle of ptrace access > logic... Yes. and if it was not clear I didn't try to seriously suggest to use this barrier. I was just curious if it can be used or not in this particular case. > Anyway, looking at it, I think smp_acquire__after_ctrl_dep() doesn't > make sense here; Well I still _think_ it should work, it provides the LOAD-LOAD ordering and this is what we need. But I can be easily wrong, and again, I wasn't serious. Oleg.