mirror of
https://sourceware.org/git/glibc.git
synced 2024-09-19 16:10:01 +00:00
aarch64: Process gnu properties in static exe
Unlike for BTI, the kernel does not process GCS properties so update GL(dl_aarch64_gcs) before the GCS status is set.
This commit is contained in:
parent
e6b927e2f9
commit
435305562e
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#ifndef SHARED
|
#ifndef SHARED
|
||||||
|
|
||||||
|
# include <dl-prop.h>
|
||||||
|
|
||||||
# ifndef PR_SET_SHADOW_STACK_STATUS
|
# ifndef PR_SET_SHADOW_STACK_STATUS
|
||||||
# define PR_GET_SHADOW_STACK_STATUS 71
|
# define PR_GET_SHADOW_STACK_STATUS 71
|
||||||
# define PR_SET_SHADOW_STACK_STATUS 72
|
# define PR_SET_SHADOW_STACK_STATUS 72
|
||||||
@ -36,6 +38,16 @@ aarch64_libc_setup_tls (void)
|
|||||||
{
|
{
|
||||||
__libc_setup_tls ();
|
__libc_setup_tls ();
|
||||||
|
|
||||||
|
struct link_map *main_map = _dl_get_dl_main_map ();
|
||||||
|
const ElfW(Phdr) *phdr = GL(dl_phdr);
|
||||||
|
const ElfW(Phdr) *ph;
|
||||||
|
for (ph = phdr; ph < phdr + GL(dl_phnum); ph++)
|
||||||
|
if (ph->p_type == PT_GNU_PROPERTY)
|
||||||
|
{
|
||||||
|
_dl_process_pt_gnu_property (main_map, -1, ph);
|
||||||
|
_rtld_main_check (main_map, _dl_argv[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
uint64_t s = GL(dl_aarch64_gcs);
|
uint64_t s = GL(dl_aarch64_gcs);
|
||||||
if (s != 0)
|
if (s != 0)
|
||||||
INLINE_SYSCALL_CALL (prctl, PR_SET_SHADOW_STACK_STATUS, s, 0, 0, 0);
|
INLINE_SYSCALL_CALL (prctl, PR_SET_SHADOW_STACK_STATUS, s, 0, 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user