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:	Fri, 8 May 2009 13:31:36 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] ring-buffer: change WARN_ON from checking
	preempt_count to preemptible


* Steven Rostedt <rostedt@...dmis.org> wrote:

> 
> 
> On Thu, 7 May 2009, Andrew Morton wrote:
> 
> > On Fri, 08 May 2009 00:32:54 -0400 Steven Rostedt <rostedt@...dmis.org> wrote:
> > 
> > > From: Steven Rostedt <srostedt@...hat.com>
> > > 
> > > There's a WARN_ON in the ring buffer code that makes sure preemption
> > > is disabled. It checks "!preempt_count()". But when CONFIG_PREEMPT is not
> > > enabled, preempt_count() is always zero, and this will trigger the warning.
> > > 
> > > [ Impact: prevent false warning on non preemptible kernels ]
> > > 
> > > Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
> > > ---
> > >  kernel/trace/ring_buffer.c |    2 +-
> > >  1 files changed, 1 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> > > index 3ae5ccf..3611706 100644
> > > --- a/kernel/trace/ring_buffer.c
> > > +++ b/kernel/trace/ring_buffer.c
> > > @@ -1688,7 +1688,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer,
> > >  	 * committed yet. Thus we can assume that preemption
> > >  	 * is still disabled.
> > >  	 */
> > > -	RB_WARN_ON(buffer, !preempt_count());
> > > +	RB_WARN_ON(buffer, preemptible());
> > >  
> > >  	cpu = smp_processor_id();
> > >  	cpu_buffer = buffer->buffers[cpu];
> > 
> > smp_processor_id() will warn too.
> > 
> 
> The difference is that RB_WARN_ON also disables the ring buffer.

Yes, it's a more robust form of warning, in this context.

	Ingo
--
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