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:   Wed, 10 May 2017 12:30:57 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Michael Ellerman <mpe@...erman.id.au>,
        LKML <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Sebastian Siewior <bigeasy@...utronix.de>
Subject: Re: [patch V2 24/24] cpu/hotplug: Convert hotplug locking to percpu
 rwsem

On Wed, 10 May 2017 10:49:09 +0200 (CEST)
Thomas Gleixner <tglx@...utronix.de> wrote:

> On Wed, 10 May 2017, Michael Ellerman wrote:
> 
> > Thomas Gleixner <tglx@...utronix.de> writes:
> >   
> > > @@ -130,6 +130,7 @@ void __static_key_slow_inc(struct static
> > >  	 * the all CPUs, for that to be serialized against CPU hot-plug
> > >  	 * we need to avoid CPUs coming online.
> > >  	 */
> > > +	lockdep_assert_hotplug_held();
> > >  	jump_label_lock();
> > >  	if (atomic_read(&key->enabled) == 0) {
> > >  		atomic_set(&key->enabled, -1);  
> > 
> > I seem to be hitting this assert from the ftrace event selftests,
> > enabled at boot with CONFIG_FTRACE_STARTUP_TEST=y, using next-20170509
> > (on powerpc).
> > 
> > The stupidly obvious (or perhaps obviously stupid) patch below fixes it:  
> 
> Kinda. There is more horror in that area lurking and I'm still trying to
> figure out all the convoluted call pathes.

I finally got some time to look at this. I'm looking at your commit:

commit b53e5129c4c7ab47ec4f709fd8f5784ca45fb46d
Author: Thomas Gleixner <tglx@...utronix.de>
Date:   Sun Apr 23 12:17:13 2017 +0200

    trace/perf: Cure hotplug lock ordering issues

What were the circular locking dependencies that were uncovered.

event_mutex could possibly be broken up, if that helps. It sorta became
a catch all for various modifications to tracing.

-- Steve


> 
> Thanks,
> 
> 	tglx
> 
> > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> > index daefdee9411a..5531f7ce8fa6 100644
> > --- a/kernel/trace/trace_events.c
> > +++ b/kernel/trace/trace_events.c
> > @@ -3241,9 +3241,19 @@ static __init void event_trace_self_tests(void)
> >  			continue;
> >  		}
> >  
> > +		get_online_cpus();
> > +		mutex_lock(&event_mutex);
> >  		ftrace_event_enable_disable(file, 1);
> > +		mutex_unlock(&event_mutex);
> > +		put_online_cpus();
> > +
> >  		event_test_stuff();
> > +
> > +		get_online_cpus();
> > +		mutex_lock(&event_mutex);
> >  		ftrace_event_enable_disable(file, 0);
> > +		mutex_unlock(&event_mutex);
> > +		put_online_cpus();
> >  
> >  		pr_cont("OK\n");
> >  	}
> > 
> > cheers
> >   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ