mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH -rt] fix preempt count underflow in user_trace_stop
Date: Mon, 12 Mar 2007 17:03:37 +0100	[thread overview]
Message-ID: <45F579D9.7090307@redhat.com> (raw)

When playing with trace_user_trigger_irq in order to trace
IRQ->userspace latencies, I encountered a bug in the latency tracer. If
I have wakeup_timing enabled and attempt to stop the trace in my
userspace program, the system crashes. This is caused by an unbalanced
preempt_enable() which underflows the preempt count.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

diff --git a/kernel/latency_trace.c b/kernel/latency_trace.c
index e07bb95..29dfb79 100644
--- a/kernel/latency_trace.c
+++ b/kernel/latency_trace.c
@@ -2396,7 +2396,6 @@ long user_trace_stop(void)
 		if (current != sch.task) {
 			__raw_spin_unlock(&sch.trace_lock);
 			local_irq_restore(flags);
-			preempt_enable();
 			return -EINVAL;
 		}
 		sch.task = NULL;



             reply	other threads:[~2007-03-12 16:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 16:03 Michal Schmidt [this message]
2007-03-12 16:46 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45F579D9.7090307@redhat.com \
    --to=mschmidt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®