]> git.ipfire.org Git - thirdparty/glibc.git/commit - ChangeLog
x86/CET: Fix property note parser [BZ #23467]
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 30 Jul 2018 23:14:46 +0000 (16:14 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 30 Jul 2018 23:15:38 +0000 (16:15 -0700)
commit98864ed0e055583707e37cdb7d41a9cdeac4473b
treeacf6ed5508969c54b0489b917d40df7e9a79236e
parentc92a00d865638cebcfd13cfe0c3e811f565fe43b
x86/CET: Fix property note parser [BZ #23467]

GNU_PROPERTY_X86_FEATURE_1_AND may not be the first property item.  We
need to check each property item until we reach the end of the property
or find GNU_PROPERTY_X86_FEATURE_1_AND.

This patch adds 2 tests.  The first test checks if IBT is enabled and
the second test reads the output from the first test to check if IBT
is is enabled.  The second second test fails if IBT isn't enabled
properly.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
[BZ #23467]
* sysdeps/unix/sysv/linux/x86/Makefile (tests): Add
tst-cet-property-1 and tst-cet-property-2 if CET is enabled.
(CFLAGS-tst-cet-property-1.o): New.
(ASFLAGS-tst-cet-property-dep-2.o): Likewise.
($(objpfx)tst-cet-property-2): Likewise.
($(objpfx)tst-cet-property-2.out): Likewise.
* sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c: New file.
* sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c: Likewise.
* sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S: Likewise.
* sysdeps/x86/dl-prop.h (_dl_process_cet_property_note): Parse
each property item until GNU_PROPERTY_X86_FEATURE_1_AND is found.
ChangeLog
sysdeps/unix/sysv/linux/x86/Makefile
sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S [new file with mode: 0644]
sysdeps/x86/dl-prop.h