This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: V2 [PATCH] Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509]
- From: Florian Weimer <fweimer at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 07 Nov 2018 19:32:28 +0100
- Subject: Re: V2 [PATCH] Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509]
- References: <CAMe9rOoXP7fz+XaM5hFnzDa=qSzz=8r3HkoddaTscrh7HUt03g@mail.gmail.com>
* H. J. Lu:
> The older linker treats .note.gnu.property section as a generic note
> section and just concatenates all .note.gnu.property sections from the
> inputs to the output. When the older linker is used to created the
> program on CET-enabled OS, the generated output has .note.gnu.property
> section with multiple NT_GNU_PROPERTY_TYPE_0 notes whose IBT and SHSTK
> enable bits are set even if the program isn't CET enabled. Such program
> will crash on CET-enabled machines. This patch updates the note parser:
>
> 1. Skip note parsing if a NT_GNU_PROPERTY_TYPE_0 note has been processed.
> 2. Check multiple NT_GNU_PROPERTY_TYPE_0 notes.
>
> [BZ #23509]
> * sysdeps/x86/dl-prop.h (_dl_process_cet_property_note): Skip
> note parsing if a NT_GNU_PROPERTY_TYPE_0 note has been processed.
> Update the l_cet field when processing NT_GNU_PROPERTY_TYPE_0 note.
> Check multiple NT_GNU_PROPERTY_TYPE_0 notes.
> * sysdeps/x86/link_map.h (l_cet): Expand to 3 bits, Add
> lc_unknown.
I would like to move this forward.
I think the code is okay, as long as we are confident that older linkers
will not produce multiple PT_NOTE segments, each containing one
NT_GNU_PROPERTY_TYPE_0 note. Maybe this should be mentioned in the
commit message (assuming that you agree that my understanding of the
code is correct).
Thanks,
Florian