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:	Tue, 11 May 2010 09:47:57 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, mingo@...e.hu,
	Paul Mackerras <paulus@...ba.org>,
	"David S. Miller" <davem@...emloft.net>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	perfmon2-devel@...ts.sf.net
Subject: Re: [BUG] perf_event: crash in perf_output_begin

On Mon, 2010-05-10 at 22:03 +0200, Stephane Eranian wrote:
> On Mon, May 10, 2010 at 5:52 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> > On Mon, 2010-05-10 at 17:33 +0200, Stephane Eranian wrote:
> >> Hi,
> >>
> >> While testing 2.6.34-rc7 I ran into the following issue when
> >> using BTS sampling on Intel Core. It seems like something
> >> is not terminated properly. I am sampling BTS per-thread
> >> on a test program, then hit CTRL-C, one second later my
> >> machine crashes while running bash. Crash dump below:
> >>
> >> [  750.249109] general protection fault: 0000 [#1] SMP
> >> [  750.249270] CPU 3
> >> [  750.249270] Pid: 6132, comm: bash Not tainted 2.6.34-rc7-tip+ #46
> >
> > Can you try and reverting 4fd38e4595e2f6c9d27732c042a0e16b2753049c, I
> > spend most of the day chasing that, and I can't say I'm much wiser.
> >
> 
> It seems to avoid my problem. So that means with STATE_FREE, some code
> path is exercised differently and there is leftover state that
> generates spurious
> interrupts, as if some event_sched_out() code was not executed.

You're spot on. I'll send a full new patch Ingo wards as he already
pushed out the revert.

---
 kernel/perf_event.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 180151f..91f277e 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -1871,6 +1871,7 @@ int perf_event_release_kernel(struct perf_event *event)
 {
 	struct perf_event_context *ctx = event->ctx;
 
+	perf_event_disable(event);
 	event->state = PERF_EVENT_STATE_FREE;
 
 	WARN_ON_ONCE(ctx->parent_ctx);

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