Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121012000034.GC254@brightrain.aerifal.cx>
Date: Thu, 11 Oct 2012 20:00:34 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: PATCH: dl_iterate_phdr()

On Thu, Oct 11, 2012 at 07:42:55PM -0400, Rich Felker wrote:
> Otherwise, looks okay!

Actually one more issue -- it needs to be made thread-safe. This would
just be a matter of obtaining a read-lock on the dynamic linker lock,
except that this lock should not be held during callbacks to
application code, which need not return in bounded time. Instead, I
think it would work to read the global "tail" while a read-lock is
held, then use a loop of the form:

	for (current=head; ; current=current->next) {
		...
		if (current == saved_tail) break;
	}

This will simply skip any new libraries that were not (fully) loaded
yet at the time of the call to dl_iterate_phdr.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.