[PATCH] Improve DST handling (Bug 23102, Bug 21942, Bug 18018, Bug, 23259, CVE-2011-0536 ).

Florian Weimer fweimer@redhat.com
Wed Jun 6 14:17:00 GMT 2018


On 06/06/2018 07:02 AM, Carlos O'Donell wrote:
> +/* Passed the start of a DST sequence at the first '$' occurrence.
> +   See the DL_DST_COUNT macro which inlines the strchr to find the
> +   first occurrence of '$' and optimizes that likely case that there
> +   is no DST.  If there is a DST we call into _dl_dst_count to count
> +   the number of DSTs.  We count all known DSTs regardless of
> +   __libc_enable_secure; the caller is responsible for enforcing
> +   the security of the substitution rules (usually
> +   _dl_dst_substitute).  */

Maybe kill DL_DST_COUNT?  It doesn't look useful to me.

> +      /* All DSTs must follow ELF gABI rules, see is_dst ().  */
> +      if ((len = is_dst (name, "ORIGIN")) != 0
> +	  || (len = is_dst (name, "PLATFORM")) != 0
> +	  || (len = is_dst (name, "LIB")) != 0)
>   	++cnt;

len is never read, so you can remove the variable.

Thanks,
Florian



More information about the Libc-alpha mailing list