glibc/sysdeps/unix/sysv/linux/x86
H.J. Lu 394df3815e x86/CET: Extend arch_prctl syscall for CET control
CET arch_prctl bits should be defined in <asm/prctl.h> from Linux kernel
header files.  Add x86 <include/asm/prctl.h> for pre-CET kernel header
files.

Note: sysdeps/unix/sysv/linux/x86/include/asm/prctl.h should be removed
if <asm/prctl.h> from the required kernel header files contains CET
arch_prctl bits.

 /* CET features:
    IBT:   GNU_PROPERTY_X86_FEATURE_1_IBT
    SHSTK: GNU_PROPERTY_X86_FEATURE_1_SHSTK
  */

 /* Return CET features in unsigned long long *addr:
      features: addr[0].
      shadow stack base address: addr[1].
      shadow stack size: addr[2].
  */
 # define ARCH_CET_STATUS		0x3001
 /* Disable CET features in unsigned int features.  */
 # define ARCH_CET_DISABLE		0x3002
 /* Lock all CET features.  */
 # define ARCH_CET_LOCK			0x3003
 /* Allocate a new shadow stack with unsigned long long *addr:
      IN: requested shadow stack size: *addr.
      OUT: allocated shadow stack address: *addr.
  */
 # define ARCH_CET_ALLOC_SHSTK		0x3004
 /* Return legacy region bitmap info in unsigned long long *addr:
     address: addr[0].
     size: addr[1].
  */
 # define ARCH_CET_LEGACY_BITMAP	0x3005

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

	* sysdeps/unix/sysv/linux/x86/include/asm/prctl.h: New file.
	* sysdeps/unix/sysv/linux/x86/cpu-features.c: Include
	<sys/prctl.h> and <asm/prctl.h>.
	(get_cet_status): Call arch_prctl with ARCH_CET_STATUS.
	* sysdeps/unix/sysv/linux/x86/dl-cet.h: Include <sys/prctl.h>
	and <asm/prctl.h>.
	(dl_cet_allocate_legacy_bitmap): Call arch_prctl with
	ARCH_CET_LEGACY_BITMAP.
	(dl_cet_disable_cet): Call arch_prctl with ARCH_CET_DISABLE.
	(dl_cet_lock_cet): Call arch_prctl with ARCH_CET_LOCK.
	* sysdeps/x86/libc-start.c: Include <startup.h>.
2018-07-24 12:23:17 -07:00
..
bits Add SHM_STAT_ANY from Linux 4.17 to bits/shm.h. 2018-06-18 13:37:57 +00:00
include/asm x86/CET: Extend arch_prctl syscall for CET control 2018-07-24 12:23:17 -07:00
sys Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h. 2018-04-24 12:11:35 +00:00
arch-pkey.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
cpu-features.c x86/CET: Extend arch_prctl syscall for CET control 2018-07-24 12:23:17 -07:00
dl-cet.h x86/CET: Extend arch_prctl syscall for CET control 2018-07-24 12:23:17 -07:00
dl-sysdep.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elision-conf.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elision-conf.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elision-lock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elision-timed.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elision-trylock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
elision-unlock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
force-elision.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gettimeofday.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
hle.h Move remaining files out of nptl/sysdeps/unix/sysv/linux/x86/. 2014-05-14 15:32:18 -07:00
Implies Consolidate pthreadtype.h placementConsolidate pthreadtype.h placement 2017-04-10 17:33:10 -03:00
jmp_buf-ssp.sym x86: Make a space in jmpbuf for shadow stack pointer 2017-11-30 04:58:01 -08:00
libc-vdso.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Makefile x86: Support shadow stack pointer in setjmp/longjmp 2018-07-14 05:59:53 -07:00
pkey_get.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pkey_set.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread_mutex_cond_lock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread_mutex_lock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread_mutex_timedlock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
pthread_mutex_trylock.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
setjmpP.h x86: Use pad in pthread_unwind_buf to preserve shadow stack register 2018-05-02 06:17:41 -07:00
sysconf.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
time.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-saved_mask-1.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00