This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Set NODELETE flag after checking for NULL pointer
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 11 Mar 2016 19:56:52 +0100
- Subject: Re: [PATCH] Set NODELETE flag after checking for NULL pointer
- Authentication-results: sourceware.org; auth=none
- References: <1457721020-5824-1-git-send-email-aurelien at aurel32 dot net> <56E30F7E dot 2000305 at redhat dot com> <20160311184312 dot GA6216 at aurel32 dot net>
On 03/11/2016 07:43 PM, Aurelien Jarno wrote:
> On 2016-03-11 19:33, Florian Weimer wrote:
>> On 03/11/2016 07:30 PM, Aurelien Jarno wrote:
>>> The commit b632bdd3 moved the setting of the DF_1_NODELETE flag earlier
>>> in the dl_open_worker function. However when calling dlopen with both
>>> RTLD_NODELETE and RTLD_NOLOAD (which in practice also requires
>>> RTLD_LAZY), the pointer returned by _dl_map_object is NULL. This
>>> condition is checked just after setting the flag, while it should be
>>> done before. Fix that.
>>
>> How hard is it to create a test case for this?
>
> That should be relatively easy I guess. If the patch makes sense, I can
> try to add one.
The change looks reasonable and correct to me, but the dynamic linker
scares me …
Thanks,
Florian