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] [day] [month] [year] [list]
Date:	Wed, 19 Nov 2008 10:23:54 +0100
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: Re: ftrace: preemptoff selftest not working

On Wed, Nov 19, 2008 at 10:02:23AM +0100, Ingo Molnar wrote:
> 
> >  #ifdef CONFIG_FTRACE_STARTUP_TEST
> > +	/*
> > +	 * When this gets called we hold the BKL which means that preemption
> > +	 * is disabled. Various trace selftests however need to disable
> > +	 * and enable preemption for successful tests. So we drop the BKL here
> > +	 * and grab it after the tests again.
> > +	 */
> > +	unlock_kernel();
> >  	if (type->selftest) {
> >  		struct tracer *saved_tracer = current_trace;
> >  		struct trace_array *tr = &global_trace;
> > @@ -562,6 +569,7 @@ int register_tracer(struct tracer *type)
> >  		}
> >  		printk(KERN_CONT "PASSED\n");
> >  	}
> > +	lock_kernel();
> 
> dropping the BKL was a good idea, but the code flow was not 
> investigated thoroughly enough, which caused this crash to trigger in 
> -tip testing:

Yes, I came to the same conlcusion this morning after reading the patch
again and wanted to send a follow-up patch. But you were faster ;)

Anyway, what bothers me more is the question if the idea to drop the BKL
in register_tracer is good. It's probably just a question of time until
the first tracers come in modules. And then the unlock_kernel()/lock_kernel()
sequence would be broken.
So it probably might make more sense to drop and grab the BKL in the
init functions that register a tracer?

But.. maybe the BKL is gone until this is an issue ;)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ