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, 9 Mar 2011 14:52:55 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	LKML <linux-kernel@...r.kernel.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Paul Mackerras <paulus@...ba.org>,
	Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 1/2] perf: Fix the software events state check

On Wed, Mar 09, 2011 at 10:28:18AM +0100, Ingo Molnar wrote:
> 
> * Frederic Weisbecker <fweisbec@...il.com> wrote:
> 
> > Fix the mistakenly inverted check of events state.
> > 
> > Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
> > Cc: Ingo Molnar <mingo@...e.hu>
> > Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> > Cc: Paul Mackerras <paulus@...ba.org>
> > Cc: Stephane Eranian <eranian@...gle.com>
> > ---
> >  kernel/perf_event.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/kernel/perf_event.c b/kernel/perf_event.c
> > index ed253aa..974e2e6 100644
> > --- a/kernel/perf_event.c
> > +++ b/kernel/perf_event.c
> > @@ -5122,7 +5122,7 @@ static int perf_exclude_event(struct perf_event *event,
> >  			      struct pt_regs *regs)
> >  {
> >  	if (event->hw.state & PERF_HES_STOPPED)
> > -		return 0;
> > +		return 1;
> 
> Just wondering, what was/is the practical effect of this bug, and how far back does 
> it go (any need for a -stable tag)?

I wasn't sure about that so I haven't told about the impact in the
changelog.

But now that I put a deeper look into this:

It seems that ->stop() / ->start() are called from perf_adjust_period()
to update the hardware with the new settings of period_left. The events
are stopped to avoid any race with events triggering with a stale period_left
in the hardware level when the software one has been updated, I guess.

So it doesn't seem to fix any existing bug because for ->stop() and ->start()
are only useful for hardware events right now. But we may call ->stop() and
->start() for further purpose later. In fact that paves the way for the event
exclusion patchset I'm about to post.

So it should be .39 material. But a confirmation from Peter would be nice.
--
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