[PATCH v2] elf: prevent NULL-dereference in _dl_map_new_object()
Anastasia Belova
abelova@astralinux.ru
Mon Jul 21 09:58:55 GMT 2025
If name = NULL going to no_file leads to NULL-dereference
while calling __strdup(name). Exit the program instead.
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"));
}
if (before != name && strcmp (before, name) != 0)
origname = before;
@@ -2126,9 +2127,6 @@ _dl_map_new_object (struct link_map *loader, const char *name,
}
}
-#ifdef SHARED
- no_file:
-#endif
/* In case the LOADER information has only been provided to get to
the appropriate RUNPATH/RPATH information we do not need it
anymore. */
--
2.30.2
More information about the Libc-alpha
mailing list