[PATCH v6 13/20] elf: Fix initial-exec TLS access on audit modules (BZ #28096)

Florian Weimer fweimer@redhat.com
Sat Dec 18 18:01:06 GMT 2021


* Adhemerval Zanella:

> diff --git a/elf/dl-object.c b/elf/dl-object.c
> index 1875599eb2..eb2158a84b 100644
> --- a/elf/dl-object.c
> +++ b/elf/dl-object.c
> @@ -175,6 +175,9 @@ _dl_new_object (char *realname, const char *libname, int type,
>  
>    new->l_local_scope[0] = &new->l_searchlist;
>  
> +  if (mode & __RTLD_AUDIT)
> +    new->l_dont_set_tls_static = 1;
> +
>    /* Determine the origin.  If allocating the link map for the main
>       executable, the realname is not known and "".  In this case, the
>       origin needs to be determined by other means.  However, in case

Is this sufficient?  What happens if an auditor calls dlopen?  I don't
see anything that causes that dlopen call to use __RTLD_AUDIT, so

I suspect the change in initialization logic needs to be changed for
audit namespaces, not just each audit module contained in them.

Thanks,
Florian



More information about the Libc-alpha mailing list