[PATCH v2] elf: prevent NULL-dereference in _dl_map_new_object()
Anastasia Belova
abelova@astralinux.ru
Mon Jul 21 10:19:41 GMT 2025
21/07/25 13:09, Florian Weimer:
> * Anastasia Belova:
>
>> If name = NULL going to no_file leads to NULL-dereference
>> while calling __strdup(name). Exit the program instead.
> This does not exit the program. It fails dlopen.
>
>> Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
>> ---
>> elf/dl-load.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/elf/dl-load.c b/elf/dl-load.c
>> index 00b9da9ec7..b63139dfc3 100644
>> --- a/elf/dl-load.c
>> +++ b/elf/dl-load.c
>> @@ -1954,7 +1954,8 @@ _dl_map_new_object (struct link_map *loader, const char *name,
>> if (name == NULL)
>> {
>> fd = -1;
>> - goto no_file;
>> + _dl_signal_error (errno, before, NULL,
>> + N_("auditor declined to load object"));
> Sorry, missed this before. The value of errno is not necessary correct
> at this point, so th ecall should probably use 0 instead of errno here.
Ok, I'll fix it it 3rd version.
> Do you plan to work on a test case?
Unfortunately, I will only have time for this in 3 weeks. Should I send
the next
version then?
Anastasia
More information about the Libc-alpha
mailing list