lkml.org 
[lkml]   [2012]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: lockdep: Warning & NULL ptr deref
From
Date
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 ?


\
 
 \ /
  Last update: 2012-02-28 15:23    [from the cache]
©2003-2011 Jasper Spaans