This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: V3 [PATCH] x86/CET: Fix property note parser [BZ #23467]
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 30 Jul 2018 16:09:54 -0300
- Subject: Re: V3 [PATCH] x86/CET: Fix property note parser [BZ #23467]
- References: <CAMe9rOoepM==U4XkyXDRugJaJ=kZ+GOAEfJNzXGiCtJw7OUcbw@mail.gmail.com> <24b93543-b78b-ba73-764e-389c673c69ad@linaro.org> <CAMe9rOrmOiZn_2aw4=7MPLoHtYUEC1vXCL=wudHT1O2P6AT5Rw@mail.gmail.com>
On 30/07/2018 15:56, H.J. Lu wrote:
>>> +
>>> + test (bar);
>>> +
>>> + return EXIT_FAILURE;
>>> +}
>>
>>> diff --git a/sysdeps/x86/dl-prop.h b/sysdeps/x86/dl-prop.h
>>> index 35d3f16a23..d9e0770e29 100644
>>> --- a/sysdeps/x86/dl-prop.h
>>> +++ b/sysdeps/x86/dl-prop.h
>>> @@ -73,7 +73,7 @@ _dl_process_cet_property_note (struct link_map *l,
>>> unsigned char *ptr = (unsigned char *) (note + 1) + 4;
>>> unsigned char *ptr_end = ptr + note->n_descsz;
>>>
>>
>> Should we care for overflow here (I guess not since we don't really
>> protected against ill-formed elf files in general)?
>
> We do protect against ill-formed notes. When we get here, the whole
> note has been loaded into memory. There won't be overflow.
Indeed, LGTM to me then.