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]
Message-ID: <alpine.DEB.2.00.0904070521510.22758@gandalf.stny.rr.com>
Date:	Tue, 7 Apr 2009 05:24:00 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Tom Zanussi <tzanussi@...il.com>
cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 4/4] tracing/filters: use ring_buffer_discard_commit for
 discarded events


On Tue, 7 Apr 2009, Tom Zanussi wrote:
> 
> > The bug does not stick out in this patch set. Perhaps it is part of the 
> > original too?  But something somewhere is calling the discard outside the 
> > reserve and commit.
> > 
> 
> It doesn't stick out to me either - the funny thing is that it only
> happens with CONFIG_PREEMPT_VOLUNTARY - with CONFIG_PREEMPT it's fine.
> 
> In fact, with CONFIG_PREEMPT_VOLUNTARY, an RB_WARN_ON(!preempt_count())
> right after frace_preempt_disable() triggers immediately, which unless
> I'm missing something, should never happen.  Is there a bug in
> PREEMPT_VOLUNTARY?
> 
> Tom
> 
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 7a6209f..bac9ab7 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -1494,6 +1494,8 @@ ring_buffer_lock_reserve(struct ring_buffer *buffer, unsigned long length)
>  	/* If we are tracing schedule, we don't want to recurse */
>  	resched = ftrace_preempt_disable();
>  
> +	RB_WARN_ON(buffer, !preempt_count());

Ug, I'm an idiot ;-)

PREEMPT_VOLUNTARY will always have preempt_count return zero. We need a:

	RB_WARN_ON_PREEMPT(buffer);

macro, so that we can define it to warn on CONFIG_PREEMPT but have it be a
nop for all else.

Note, I'm currently traveling so my response times will be limited.

-- Steve

> +
>  	cpu = raw_smp_processor_id();
>  
>  	if (!cpumask_test_cpu(cpu, buffer->cpumask))
> 
> 
--
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