mirror of git://sourceware.org/git/glibc.git
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.
(cherry picked from commit 2ef23b5205
)
This commit is contained in:
parent
56fbd0ba21
commit
4a68828e37
1
NEWS
1
NEWS
|
@ -77,6 +77,7 @@ The following bugs are resolved with this release:
|
||||||
[25423] Array overflow in backtrace on powerpc
|
[25423] Array overflow in backtrace on powerpc
|
||||||
[25933] Off by one error in __strncmp_avx2
|
[25933] Off by one error in __strncmp_avx2
|
||||||
[27130] "rep movsb" performance issue
|
[27130] "rep movsb" performance issue
|
||||||
|
[27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
|
||||||
|
|
||||||
Security related changes:
|
Security related changes:
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,12 @@ endif
|
||||||
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 ($(enable-cet),yes)
|
ifeq ($(enable-cet),yes)
|
||||||
|
|
|
@ -105,7 +105,11 @@ 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)
|
||||||
|
{
|
||||||
|
THREAD_SETMEM (THREAD_SELF, header.feature_1,
|
||||||
|
GL(dl_x86_feature_1)[0]);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if IBT is enabled by kernel. */
|
/* Check if IBT is enabled by kernel. */
|
||||||
bool ibt_enabled
|
bool ibt_enabled
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
#include <setjmp/tst-setjmp.c>
|
Loading…
Reference in New Issue