V2 [PATCH] Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509]

Florian Weimer fweimer@redhat.com
Sat Sep 22 11:07:00 GMT 2018


* H. J. Lu:

> My goal is to allow older linkers which don't understand property notes
> to generate working executables on CET enabled OS.  It isn't tended to
> handle all hand-crafted binaries.  The worst case is that such binaries
> won't run on CET enabled OS.  I don't believe it is an issue.  It may even
> be a bonus.
>
> Do you have a testcase which may be generated by an old linker on
> CET enabled OS?

My position is that ELF is an open format and that we don't really know
what kind of link editors are out there and are used in practice.

Other views are certainly possible.  I mainly wanted to understand the
rationale behind the code.  If you do not expect multiple PT_NOTE
segments with properly aligned property notes, I think that's okay.  We
can adjust the dynamic linker again if such binaries show up in the
future.

>> Okay, that part makes sense because it's internal to the notes AFAICS.
>> And note merging without GNU property note awareness will likely violate
>> this constraint.  Maybe you could add a comment to this effect?
>
> I updated comments to
>
>               /* Property types must be sorted in ascending order.
>                  Ignore property note with the wrong type order.  */
>               if (type < last_type)
>                 return;

Thanks.

Florian



More information about the Libc-alpha mailing list