mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
x86: Set header.feature_1 in TCB for always-on CET [BZ #27177]
Update dl_cet_check() to set header.feature_1 in TCB when both IBT and SHSTK are always on.
This commit is contained in:
parent
f430293d84
commit
2ef23b5205
@ -48,6 +48,12 @@ endif # $(subdir) == math
|
|||||||
ifeq ($(subdir),setjmp)
|
ifeq ($(subdir),setjmp)
|
||||||
gen-as-const-headers += jmp_buf-ssp.sym
|
gen-as-const-headers += jmp_buf-ssp.sym
|
||||||
sysdep_routines += __longjmp_cancel
|
sysdep_routines += __longjmp_cancel
|
||||||
|
ifneq ($(enable-cet),no)
|
||||||
|
ifneq ($(have-tunables),no)
|
||||||
|
tests += tst-setjmp-cet
|
||||||
|
tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
|
||||||
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(subdir),string)
|
ifeq ($(subdir),string)
|
||||||
|
@ -47,7 +47,10 @@ dl_cet_check (struct link_map *m, const char *program)
|
|||||||
/* No legacy object check if both IBT and SHSTK are always on. */
|
/* No legacy object check if both IBT and SHSTK are always on. */
|
||||||
if (enable_ibt_type == cet_always_on
|
if (enable_ibt_type == cet_always_on
|
||||||
&& enable_shstk_type == cet_always_on)
|
&& enable_shstk_type == cet_always_on)
|
||||||
return;
|
{
|
||||||
|
THREAD_SETMEM (THREAD_SELF, header.feature_1, GL(dl_x86_feature_1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if IBT is enabled by kernel. */
|
/* Check if IBT is enabled by kernel. */
|
||||||
bool ibt_enabled
|
bool ibt_enabled
|
||||||
|
1
sysdeps/x86/tst-setjmp-cet.c
Normal file
1
sysdeps/x86/tst-setjmp-cet.c
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include <setjmp/tst-setjmp.c>
|
Loading…
Reference in New Issue
Block a user