All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Dave Jones <davej@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: lockdep: Warning & NULL ptr deref
Date: Tue, 28 Feb 2012 15:20:53 +0100	[thread overview]
Message-ID: <1330438853.11248.90.camel@twins> (raw)
In-Reply-To: <CA+1xoqfMad+s4-E-Nn29m3=bVASEkH38ZNvWg2vY99ZizdAT3Q@mail.gmail.com>

On Tue, 2012-02-28 at 16:19 +0200, Sasha Levin wrote:
> On Tue, Feb 28, 2012 at 3:29 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Tue, 2012-02-28 at 10:24 -0500, Sasha Levin wrote:
> >>
> >> I'll send some patches to prevent the NULL deref itself which happens
> >> since a chunk of the code in lockdep.c assumed hlock_class() can't
> >> return NULL.
> >>
> > There's tons of code actually assuming that..
> >
> >> This won't fix the actual problem though, I'm not sure exactly how a
> >> held lock wouldn't have a class initialized to it.
> >
> > static inline struct lock_class *hlock_class(struct held_lock *hlock)
> > {
> >        if (!hlock->class_idx) {
> >                /*
> >                 * Someone passed in garbage, we give up.
> >                 */
> >                DEBUG_LOCKS_WARN_ON(1);
> >                return NULL;
> >        }
> >        return lock_classes + hlock->class_idx - 1;
> > }
> >
> > Typically that translates to severe memory corruption.
> 
> I can also reproduce it easily by triggering sysrq once or twice after
> trinity has stopped.

What's trinity ?

  reply	other threads:[~2012-02-28 14:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 15:24 lockdep: Warning & NULL ptr deref Sasha Levin
2012-02-28 13:29 ` Peter Zijlstra
2012-02-28 14:13   ` Sasha Levin
2012-02-28 14:19   ` Sasha Levin
2012-02-28 14:20     ` Peter Zijlstra [this message]
2012-02-28 14:23       ` Sasha Levin
2012-02-28 14:26         ` Peter Zijlstra
2012-02-28 14:55           ` Sasha Levin
2012-02-28 15:08             ` Peter Zijlstra
2012-02-28 16:02               ` Sasha Levin

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=1330438853.11248.90.camel@twins \
    --to=peterz@infradead.org \
    --cc=davej@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.