[PATCH v4] elf: Only allow execute libc.so.6 directly [BZ #28453]
Florian Weimer
fweimer@redhat.com
Fri Dec 10 14:58:55 GMT 2021
* H. J. Lu:
> + /* With DT_NEEDED dependencies, it is a shared library. Only allow
> + execute libc.so directly. */
> + if (__glibc_unlikely (main_map->l_info[DT_NEEDED] != NULL))
> + return (main_map->l_info[DT_SONAME] != NULL
> + && strncmp ("libc.so.6",
> + ((const char *) D_PTR (main_map, l_info[DT_STRTAB])
> + + main_map->l_info[DT_SONAME]->d_un.d_val),
> + sizeof ("libc.so.6") - 1) == 0);
I don't think this works. See /usr/bin/npc in Fedora, it has a soname.
Thanks,
Florian
More information about the Libc-alpha
mailing list