glibc/sysdeps/unix/sysv/linux/x86
H.J. Lu f81ddabffd Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563]
On x86, padding in struct __jmp_buf_tag is used for shadow stack pointer
to support shadow stack in Intel Control-flow Enforcemen Technology.
Since the cancel_jmp_buf array is passed to setjmp and longjmp by
casting it to pointer to struct __jmp_buf_tag, it should be as large
as struct __jmp_buf_tag.  Otherwise when shadow stack is enabled,
setjmp and longjmp will write and read beyond cancel_jmp_buf when saving
and restoring shadow stack pointer.

This patch adds bits/types/__cancel_jmp_buf_tag.h to define struct
__cancel_jmp_buf_tag so that Linux/x86 can add saved_mask to
cancel_jmp_buf.

Tested natively on i386, x86_64 and x32.  Tested hppa-linux-gnu with
build-many-glibcs.py.

	[BZ #22563]
	* bits/types/__cancel_jmp_buf_tag.h: New file.
	* sysdeps/unix/sysv/linux/x86/bits/types/__cancel_jmp_buf_tag.h
	* sysdeps/unix/sysv/linux/x86/pthreaddef.h: Likewise.
	* sysdeps/unix/sysv/linux/x86/nptl/pthreadP.h: Likewise.
	* nptl/Makefile (headers): Add
	bits/types/__cancel_jmp_buf_tag.h.
	* nptl/descr.h [NEED_SAVED_MASK_IN_CANCEL_JMP_BUF]
	(pthread_unwind_buf): Add saved_mask to cancel_jmp_buf.
	* sysdeps/nptl/pthread.h: Include
	<bits/types/__cancel_jmp_buf_tag.h>.
	(__pthread_unwind_buf_t): Use struct __cancel_jmp_buf_tag with
	__cancel_jmp_buf.
	* sysdeps/unix/sysv/linux/hppa/pthread.h: Likewise.
2017-12-19 02:44:04 -08:00
..
bits Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563] 2017-12-19 02:44:04 -08:00
nptl Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563] 2017-12-19 02:44:04 -08:00
sys Fix mcontext_t sigcontext namespace (bug 21457). 2017-08-30 22:02:04 +00:00
arch-pkey.h Linux: Implement interfaces for memory protection keys 2017-12-05 15:20:35 +01:00
dl-sysdep.c tunables: Add IFUNC selection and cache sizes 2017-06-20 08:37:28 -07:00
elision-conf.c Add elision tunables 2017-12-05 17:48:48 -02:00
elision-conf.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-lock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-timed.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-trylock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
elision-unlock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
force-elision.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gettimeofday.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +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 x86: Mark VDSO_SYMBOL(getcpu) with attribute_hidden [BZ #18822] 2017-08-21 05:40:45 -07:00
Makefile x86: Make a space in jmpbuf for shadow stack pointer 2017-11-30 04:58:01 -08:00
pkey_get.c Linux: Implement interfaces for memory protection keys 2017-12-05 15:20:35 +01:00
pkey_set.c Linux: Implement interfaces for memory protection keys 2017-12-05 15:20:35 +01:00
pthread_mutex_cond_lock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_mutex_lock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_mutex_timedlock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread_mutex_trylock.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthreaddef.h Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563] 2017-12-19 02:44:04 -08:00
setjmpP.h x86: Make a space in jmpbuf for shadow stack pointer 2017-11-30 04:58:01 -08:00
sysconf.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
time.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-saved_mask-1.c x86: Make a space in jmpbuf for shadow stack pointer 2017-11-30 04:58:01 -08:00