All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jann Horn <jannh@google.com>,
	"Eric W . Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	David Howells <dhowells@redhat.com>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ptrace: restore smp_rmb() in __ptrace_may_access()
Date: Fri, 31 May 2019 11:55:53 +0200	[thread overview]
Message-ID: <20190531095553.GA31323@redhat.com> (raw)
In-Reply-To: <20190531091245.GN2677@hirez.programming.kicks-ass.net>

On 05/31, Peter Zijlstra wrote:
>
> On Thu, May 30, 2019 at 02:05:31PM +0200, Oleg Nesterov wrote:
> > > 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.
>
> So it hard relies on being part of a control dependency,

Yes,

> IOW, it is an error to use smp_acquire__after_ctrl_dep() without an
> (immediate) preceding branch.

and it is still not clear to me if __ptrace_may_acess() has a control
dependency or not,

		if (uid_eq(caller_uid, tcred->euid) && ...)
			goto ok;
		retuurn;

	ok:
		// provide LOAD->LOAD
		smp_acquire__after_ctrl_dep();


again, again, I didn't suggest to change the patch, I was just curious
if it would be correct or not.

Oleg.


  reply	other threads:[~2019-05-31  9:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 11:31 [PATCH] ptrace: restore smp_rmb() in __ptrace_may_access() Jann Horn
2019-05-29 15:59 ` Eric W. Biederman
2019-05-29 16:01   ` Jann Horn
2019-05-29 16:21 ` Oleg Nesterov
2019-05-29 17:38   ` Jann Horn
2019-05-30  1:41     ` Eric W. Biederman
2019-05-31 15:04       ` Jann Horn
2019-05-30 10:34     ` Andrea Parri
2019-05-31  9:08       ` Peter Zijlstra
2019-05-30 12:05     ` Oleg Nesterov
2019-05-31  9:12       ` Peter Zijlstra
2019-05-31  9:55         ` Oleg Nesterov [this message]
2019-05-29 21:02   ` Jann Horn
2019-05-29 18:55 ` Kees Cook
2019-05-30 12:34 ` Oleg Nesterov
2019-05-31 11:56   ` Jann Horn
2019-05-31 13:35     ` Oleg Nesterov
2019-05-31 19:37       ` Jann Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190531095553.GA31323@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.