This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On 06/11/2018 04:04 AM, Andreas Schwab wrote:
> On Jun 07 2018, Carlos O'Donell <carlos@redhat.com> wrote:
> 
>> Careful, is_dst () takes as input the start of a DST sequence,
>> but that sequence is not validated yet.
> 
> You have already validated the prefix by comparing it with the string,
> and you only have to check the next character.

By validating it against the abstract definition of the ELF gABI spec 
for a DST name it prevents any future caller from accidentally straying
outside of that contract without having to make two changes: (1) change 
the comparison DST and (2) change what we accept in is_dst().

Also I find the code ends up being simpler. Right now we compute the
longest DST name possible and then the checks are much easier after
that.

Is there a strong performance argument to be made for not doing the
validation?

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]