glibc/sysdeps/nptl
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 nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
sys Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
aio_misc.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
allocrtsig.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fork.c nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
fork.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
futex-internal.h Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
gai_misc.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Implies
internaltypes.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmp-unwind.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libc-lock.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libc-lockP.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
librt-cancellation.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lowlevellock-futex.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lowlevellock.h Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock. 2017-02-06 13:46:01 +01:00
Makeconfig Remove add-ons mechanism. 2017-10-05 15:58:13 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
malloc-machine.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
nptl-signals.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread-functions.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread.h Linux/x86: Update cancel_jmp_buf to match __jmp_buf_tag [BZ #22563] 2017-12-19 02:44:04 -08:00
setxid.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
shm-directory.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigfillset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stdio-lock.h Remove _IO_MTSAFE_IO from public headers. 2017-05-11 19:14:11 -04:00
Subdirs
tcb-offsets.h
tst-mqueue8x.c
unwind-forcedunwind.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00