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]
Message-ID: <CA+1xoqeEa2E7iu+RPiHTYoQO3739UKQm_PjAbxZA0-f+ped+tA@mail.gmail.com>
Date:	Tue, 28 Feb 2012 16:55:17 +0200
From:	Sasha Levin <levinsasha928@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Dave Jones <davej@...hat.com>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: lockdep: Warning & NULL ptr deref

On Tue, Feb 28, 2012 at 4:26 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, 2012-02-28 at 16:23 +0200, Sasha Levin wrote:
>> On Tue, Feb 28, 2012 at 4:20 PM, Peter Zijlstra <peterz@...radead.org> wrote:
>> > On Tue, 2012-02-28 at 16:19 +0200, Sasha Levin wrote:
>> >> On Tue, Feb 28, 2012 at 3:29 PM, Peter Zijlstra <peterz@...radead.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 ?
>>
>> Dave Jones' fuzzer tool. The git tree is located here:
>> http://codemonkey.org.uk/projects/trinity/trinity.git
>
> Hmm, cute, does a kernel without lockdep explode too? If its proper
> memory corruption one would expect that.

Looks like it only happens when lockdep is there, it also happens in
the same lockdep line of code all the time.
--
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