mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 14:50:05 +00:00
x86_64: Always initialize ssp_base in the TCB if SHSTK is enabled
This commit is contained in:
parent
f5bfd0e47c
commit
90ee0d8730
@ -333,6 +333,14 @@ _dl_cet_setup_features (unsigned int cet_feature)
|
||||
enabled from executable, not necessarily supported by kernel. */
|
||||
if (cet_feature != 0)
|
||||
{
|
||||
void **ssp;
|
||||
asm ("rdsspq %0"
|
||||
: "=r" (ssp)
|
||||
: "0" (0));
|
||||
if (ssp != NULL)
|
||||
/* The caller is the top-most frame, hence the + 8. */
|
||||
THREAD_SETMEM (THREAD_SELF, header.ssp_base, ssp + 8);
|
||||
|
||||
cet_feature = dl_cet_get_cet_status ();
|
||||
if (cet_feature != 0)
|
||||
{
|
||||
|
29
sysdeps/x86_64/nptl/nptl_arch_thread_init.h
Normal file
29
sysdeps/x86_64/nptl/nptl_arch_thread_init.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* Architecture-specific thread initialization for NPTL. x86-64 version.
|
||||
Copyright (C) 2024 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
static inline __always_inline void
|
||||
__nptl_arch_thread_init (void)
|
||||
{
|
||||
#if CET_ENABLED
|
||||
void **ssp;
|
||||
asm ("rdsspq %0"
|
||||
: "=r" (ssp)
|
||||
: "0" (0));
|
||||
THREAD_SETMEM (THREAD_SELF, header.ssp_base, ssp);
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user