glibc/sysdeps/x86
H.J. Lu d524fa6c35 Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509]
Linkers group input note sections with the same name into one output
note section with the same name.  One output note section is placed in
one PT_NOTE segment.  Since new linkers merge input .note.gnu.property
sections into one output .note.gnu.property section, there is only
one NT_GNU_PROPERTY_TYPE_0 note in one PT_NOTE segment with new linkers.
Since older linkers treat input .note.gnu.property section as a generic
note section and just concatenate all input .note.gnu.property sections
into one output .note.gnu.property section without merging them, we may
see multiple NT_GNU_PROPERTY_TYPE_0 notes in one PT_NOTE segment with
older linkers.

When an older linker is used to created the program on CET-enabled OS,
the linker output has a single .note.gnu.property section with multiple
NT_GNU_PROPERTY_TYPE_0 notes, some of which have IBT and SHSTK enable
bits set even if the program isn't CET enabled.  Such programs 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.
2018-11-08 10:07:10 -08:00
..
bits Add <bits/indirect-return.h> 2018-07-24 07:55:47 -07:00
fpu Use round functions not __round functions in glibc libm. 2018-09-27 12:35:23 +00:00
nptl x86: Rename __glibc_reserved1 to feature_1 in tcbhead_t [BZ #22563] 2018-07-14 05:56:46 -07:00
Makeconfig Add _Float64x function aliases. 2017-11-27 14:16:47 +00:00
Makefile Rename the glibc.tune namespace to glibc.cpu 2018-08-02 23:49:19 +05:30
Versions Add _dl_x86_cpu_features to rtld_global 2015-08-13 03:41:22 -07:00
__longjmp_cancel.S x86: Use pad in pthread_unwind_buf to preserve shadow stack register 2018-05-02 06:17:41 -07:00
cacheinfo.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
cet-tunables.h x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
check-cet.awk x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
configure x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
configure.ac x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
cpu-features-offsets.sym x86: Cleanup cpu-features-offsets.sym 2018-08-03 06:42:09 -07:00
cpu-features.c x86: Fix Haswell strong flags (BZ#23709) 2018-10-23 14:57:02 -03:00
cpu-features.h Invert sense of list of i686-class processors in sysdeps/x86/cpu-features.h. 2018-09-20 12:43:41 +00:00
cpu-tunables.c Rename the glibc.tune namespace to glibc.cpu 2018-08-02 23:49:19 +05:30
dl-cet.c Rename the glibc.tune namespace to glibc.cpu 2018-08-02 23:49:19 +05:30
dl-get-cpu-features.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dl-hwcap.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dl-procruntime.c x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
dl-prop.h Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509] 2018-11-08 10:07:10 -08:00
dl-tunables.list Rename the glibc.tune namespace to glibc.cpu 2018-08-02 23:49:19 +05:30
elide.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
float128-abi.h Add float128 support for x86_64, x86. 2017-06-26 22:02:24 +00:00
fpu_control.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
hp-timing.h x86: Support RDTSCP for benchtests 2018-10-24 02:19:34 -07:00
init-arch.h x86: Use _rdtsc intrinsic for HP_TIMING_NOW 2018-10-17 15:16:45 -07:00
jmp_buf-ssp.sym x86: Support shadow stack pointer in setjmp/longjmp 2018-07-14 05:59:53 -07:00
ldsodefs.h x86: Add sysdeps/x86/ldsodefs.h 2018-05-14 09:19:41 -07:00
libc-start.c x86/CET: Extend arch_prctl syscall for CET control 2018-07-24 12:23:17 -07:00
libc-start.h x86: Support IBT and SHSTK in Intel CET [BZ #21598] 2018-07-16 14:08:27 -07:00
link_map.h Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509] 2018-11-08 10:07:10 -08:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
longjmp.c x86: Use pad in pthread_unwind_buf to preserve shadow stack register 2018-05-02 06:17:41 -07:00
string_private.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sysdep.h x86: Move STATE_SAVE_OFFSET/STATE_SAVE_MASK to sysdep.h 2018-08-06 06:25:43 -07:00
tininess.h Use sysdeps/x86/tininess.h for i386 and x86_64 2012-10-30 20:38:31 -07:00
tst-cet-legacy-1.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-2.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-2a.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-3.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-4.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-4a.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-4b.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-4c.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-mod-1.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-mod-2.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-cet-legacy-mod-4.c x86/CET: Add tests with legacy non-CET shared objects 2018-07-25 04:47:05 -07:00
tst-get-cpu-features-static.c Add _dl_x86_cpu_features to rtld_global 2015-08-13 03:41:22 -07:00
tst-get-cpu-features.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00