lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 29 Jan 2018 19:15:29 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
        Andy Lutomirski <luto@...nel.org>,
        "Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Andrew Hunter <ahh@...gle.com>,
        Maged Michael <maged.michael@...il.com>,
        Avi Kivity <avi@...lladb.com>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Dave Watson <davejwatson@...com>,
        "H . Peter Anvin" <hpa@...or.com>,
        Andrea Parri <parri.andrea@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Greg Hackmann <ghackmann@...gle.com>,
        Will Deacon <will.deacon@....com>,
        David Sehr <sehr@...gle.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org,
        linux-arch@...r.kernel.org
Subject: Re: [PATCH 08/11] membarrier: Provide core serializing command (v2)

On Mon, Jan 29, 2018 at 07:04:14PM +0100, Peter Zijlstra wrote:
> On Tue, Jan 23, 2018 at 10:57:30AM -0500, Mathieu Desnoyers wrote:
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index f38c4c7e256a..041893128f51 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -2662,9 +2662,13 @@ static struct rq *finish_task_switch(struct task_struct *prev)
> >  	 * thread, mmdrop()'s implicit full barrier is required by the
> >  	 * membarrier system call, because the current active_mm can
> >  	 * become the current mm without going through switch_mm().
> > +	 * membarrier also requires a core serializing instruction
> > +	 * before going back to user-space after storing to rq->curr.
> >  	 */
> > -	if (mm)
> > +	if (mm) {
> > +		membarrier_mm_sync_core_before_usermode(mm);
> >  		mmdrop(mm);
> > +	}
> 
> *confused*, when we switch from process A to process B, context_switch()
> will not set rq->prev_mm and the above mm will be NULL and we'll not
> pass through your_function_names_are_waaay_too_long and we'll not get
> cookies.
> 
> And if there's anything more complicated going on, the comment/changelog
> are not adequate.

Aaah, its the case where we do not pass through switch_mm(), the partial
comment got to me. I only realized after reading the next patch.

> >  	if (unlikely(prev_state == TASK_DEAD)) {
> >  		if (prev->sched_class->task_dead)
> >  			prev->sched_class->task_dead(prev);
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ