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: <20130510114605.GA32110@dyad.programming.kicks-ass.net>
Date:	Fri, 10 May 2013 13:46:06 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Sasha Levin <sasha.levin@...cle.com>
Cc:	torvalds@...ux-foundation.org, mingo@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 7/9] liblockdep: Support using LD_PRELOAD

On Fri, May 10, 2013 at 01:17:19PM +0200, Peter Zijlstra wrote:
> On Thu, May 09, 2013 at 11:58:07AM -0400, Sasha Levin wrote:
> > +	/*
> > +	 * Some programs attempt to initialize and use locks in their
> > +	 * allocation path. This means that a call to malloc() would
> > +	 * result in locks being initialized and locked.
> > +	 *
> > +	 * Why is it an issue for us? dlsym() below will try allocating to
> > +	 * give us the original function. Since this allocation will result
> > +	 * in a locking operations, we have to let pthread deal with it,
> > +	 * but we can't! we don't have the pointer to the original API
> > +	 * since we're inside dlsym() trying to get it :(
> > +	 *
> > +	 * We can work around it by telling the program that locking was
> > +	 * really okay, and just initialize those locks when we're fully
> > +	 * up and running (this is ok because this all happens during
> > +	 * initialization phase, when we have just one thread). But
> > +	 * this is a big TODO at this point.
> > +	 */
> > +	if (preload_started) {
> > +		printf(
> > +		"LOCKDEP error: It seems that the program you are trying to "
> > +		"debug is initializing locks in it's allocation path.\n"
> > +		"This means that liblockdep cannot reliably analyze this "
> > +		"program since we need the allocator to work before we can "
> > +		"debug locks.\nSorry!\n");
> > +
> > +		exit(1);
> > +	}
> 
> 
> Would something like the below cure things? Obviously this hasn't been near a
> compiler for the entire thing still isn't wanting to compile for me.

OK, that won't do indeed. Not being able to malloc is only part of the problem.

/me goes stare at it more
--
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