summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-25x86: Rename __glibc_reserved2 to ssp_base in tcbhead_tH.J. Lu
This will be used to record the current shadow stack base for shadow stack switching by getcontext, makecontext, setcontext and swapcontext. If the target shadow stack base is the same as the current shadow stack base, we unwind the shadow stack. Otherwise it is a stack switch and we look for a restore token to restore the target shadow stack. * sysdeps/i386/nptl/tcb-offsets.sym (SSP_BASE_OFFSET): New. * sysdeps/i386/nptl/tls.h (tcbhead_t): Replace __glibc_reserved2 with ssp_base. * sysdeps/x86_64/nptl/tcb-offsets.sym (SSP_BASE_OFFSET): New. * sysdeps/x86_64/nptl/tls.h (tcbhead_t): Replace __glibc_reserved2 with ssp_base.
2018-07-25Fix out of bounds access in findidxwc (bug 23442)Andreas Schwab
If usrc is a prefix of cp but one character shorter an out of bounds access to usrc was done.
2018-07-24Mention ISO C threads additionAdhemerval Zanella
* NEWS: Add ISO C threads addition.
2018-07-24alpha: mlock2, copy_file_range syscalls were introduced in kernel 4.13Florian Weimer
2018-07-24x86/CET: Extend arch_prctl syscall for CET controlH.J. Lu
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-24sh: Do not define __ASSUME_STATXFlorian Weimer
2018-07-24Add manual documentation for threads.hRical Jasan
This patch updates the manual and adds a new chapter to the manual, explaining types macros, constants and functions defined by ISO C11 threads.h standard. [BZ# 14092] * manual/debug.texi: Update adjacent chapter name. * manual/probes.texi: Likewise. * manual/threads.texi (ISO C Threads): New section. (POSIX Threads): Convert to a section.
2018-07-24nptl: Add test cases for ISO C11 threadsAdhemerval Zanella
This patch adds to testsuite new test cases to test all new introduced C11 threads functions, types and macros are tested. Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. Adhemerval Zanella <adhemerval.zanella@linaro.org> Juan Manuel Torres Palma <jmtorrespalma@gmail.com> [BZ #14092] * nptl/Makefile (tests): Add new test files. * nptl/tst-call-once.c : New file. Tests C11 functions and types. * nptl/tst-cnd-basic.c: Likewise. * nptl/tst-cnd-broadcast.c: Likewise. * nptl/tst-cnd-timedwait.c: Likewise. * nptl/tst-mtx-basic.c: Likewise. * nptl/tst-mtx-recursive.c: Likewise. * nptl/tst-mtx-timedlock.c: Likewise. * nptl/tst-mtx-trylock.c: Likewise. * nptl/tst-thrd-basic.c: Likewise. * nptl/tst-thrd-detach.c: Likewise. * nptl/tst-thrd-sleep.c: Likewise. * nptl/tst-tss-basic.c: Likewise.
2018-07-24nptl: Add abilist symbols for C11 threadsAdhemerval Zanella
This patch adds the required abilist symbols for C11 thread support. Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * sysdeps/unix/sysv/linux/aarch64/libc.abilist [GLIBC_2.28] (thrd_current, thrd_equal, thrd_sleep, thrd_yield): Add C11 thread symbols. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist [[GLIBC_2.28] (call_once, cnd_broadcast, cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, cnd_wait, mtx_destroy, mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlokc, thrd_create, thrd_detach, thrd_exit, thrd_join, tss_create, tss_delete, tss_get, tss_set): Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist: Likewise. ikewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist: * sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist: Likewise.
2018-07-24nptl: Add C11 threads tss_* functionsAdhemerval Zanella
This patch adds the tss_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically tss_create, tss_delete, tss_get, tss_set, and required types. Mostly of the definitions are composed based on POSIX conterparts, including tss_t (pthread_key_t). Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (thread_local): New macro. (TSS_DTOR_ITERATIONS): Likewise. (tss_t): New type. (tss_dtor_t): Likewise. (tss_create): New function. (tss_get): Likewise. (tss_set): Likewise. (tss_delete): Likewise. * nptl/Makefile (libpthread-routines): Add tss_create, tss_delete, tss_get, and tss_set objects. * nptl/Versions (libpthread) [GLIBC_2.28]: Likewise. * nptl/tss_create.c: New file. * nptl/tss_delete.c: Likewise. * nptl/tss_get.c: Likewise. * nptl/tss_set.c: Likewise. * sysdeps/nptl/threads.h (thread_local): New define. (TSS_DTOR_ITERATIONS): Likewise. (tss_t): New typedef. (tss_dtor_t): Likewise. (tss_create): New prototype. (tss_get): Likewise. (tss_set): Likewise. (tss_delete): Likewise.
2018-07-24nptl: Add C11 threads cnd_* functionsAdhemerval Zanella
This patch adds the cnd_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically cnd_broadcast, cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, cnd_wait, and required types. Mostly of the definitions are composed based on POSIX conterparts, and cnd_t is also based on internal pthreads fields, but with distinct internal layout to avoid possible issues with code interchange (such as trying to pass POSIX structure on C11 functions and to avoid inclusion of pthread.h). The idea is to make it possible to share POSIX internal implementation for mostly of the code making adjust where only required. Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (cnd_t): New type. (cnd_init): New function. (cnd_signal): Likewise. (cnd_broadcast): Likewise. (cnd_wait): Likewise. (cnd_timedwait): Likewise. (cnd_destroy): Likewise. * nptl/Makefile (libpthread-routines): Add cnd_broadcast, cnd_destroy, cnd_init, cnd_signal, cnd_timedwait, and cnd_wait object. * nptl/Versions (libpthread) [GLIBC_2.28]: Likewise. * nptl/cnd_broadcast.c: New file. * nptl/cnd_destroy.c: Likewise. * nptl/cnd_init.c: Likewise. * nptl/cnd_signal.c: Likewise. * nptl/cnd_timedwait.c: Likewise. * nptl/cnd_wait.c: Likewise. * sysdeps/nptl/threads.h (cnd_t): New type. (cnd_init): New prototype. (cnd_signa): Likewise. (cnd_broadcast): Likewise. (cnd_wait): Likewise. (cnd_timedwait): Likewise. (cnd_destroy): Likewise.
2018-07-24nptl: Add C11 threads call_once functionsAdhemerval Zanella
This patch adds the call_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically call_once and required types. Mostly of the definitions are composed based on POSIX conterparts,including once_flag (pthread_once_t). The idea is to make possible to share POSIX internal implementations for mostly of the code (and making adjustment only when required). Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (ONCE_FLAG_INIT): New macro. (once_flag): New type. (call_once): New function. * nptl/Makefile (libpthread-routines): Add call_once object. * nptl/Versions (libphread) [GLIBC_2.28]: Add call_once symbol. * nptl/call_once.c: New file. * sysdeps/nptl/threads.h (ONCE_FLAG_INIT): New define. (once_flag): New type. (call_once): New prototype.
2018-07-24nptl: Add C11 threads mtx_* functionsAdhemerval Zanella
This patch adds the mtx_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically mtx_init, mtx_destroy, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, and required types. Mostly of the definitions are composed based on POSIX conterparts, and mtx_t is also based on internal pthread fields, but with a distinct internal layout to avoid possible issues with code interchange (such as trying to pass POSIX structure on C11 functions and to avoid inclusion of pthread.h). The idea is to make possible to share POSIX internal implementations for mostly of the code (and making adjustment only when required). Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/data/threads.h-data (mtx_plain): New constant. (mtx_recursive): Likewise. (mtx_timed): Likewise. (mtx_t): New type. (mtx_init): New function. (mtx_lock): Likewise. (mtx_timedlock): Likewise. (mtx_trylock): Likewise. (mtx_unlock): Likewise. (mtx_destroy): Likewise. * nptl/Makefile (libpthread-routines): Add mtx_destroy, mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, and mtx_unlock object. * nptl/Versions (libpthread) [GLIBC_2.28]): Add mtx_init, mtx_lock, mtx_timedlock, mtx_trylock, mtx_unlock, and mtx_destroy. * nptl/mtx_destroy.c: New file. * nptl/mtx_init.c: Likewise. * nptl/mtx_lock.c: Likewise. * nptl/mtx_timedlock.c: Likewise. * nptl/mtx_trylock.c: Likewise. * nptl/mtx_unlock.c: Likewise. * sysdeps/nptl/threads.h (mtx_plain): New enumeration. (mtx_recursive): Likewise. (mtx_timed): Likewise. (mtx_t): New type. (mtx_init): New prototype. (mtx_lock): Likewise. (mtx_timedlock): Likewise. (mtx_trylock): Likewise. (mtx_unlock): Likewise. (mtx_destroy): Likewise.
2018-07-24nptl: Add C11 threads thrd_* functionsAdhemerval Zanella
This patch adds the thrd_* definitions from C11 threads (ISO/IEC 9899:2011), more specifically thrd_create, thrd_curent, rhd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, thrd_yield, and required types. Mostly of the definitions are composed based on POSIX conterparts, such as thrd_t (using pthread_t). For thrd_* function internally direct POSIX pthread call are used with the exceptions: 1. thrd_start uses pthread_create internal implementation, but changes how to actually calls the start routine. This is due the difference in signature between POSIX and C11, where former return a 'void *' and latter 'int'. To avoid calling convention issues due 'void *' to int cast, routines from C11 threads are started slight different than default pthread one. Explicit cast to expected return are used internally on pthread_create and the result is stored back to void also with an explicit cast. 2. thrd_sleep uses nanosleep internal direct syscall to avoid clobbering errno and to handle expected standard return codes. It is a cancellation entrypoint to be consistent with both thrd_join and cnd_{timed}wait. 3. thrd_yield also uses internal direct syscall to avoid errno clobbering. Checked with a build for all major ABI (aarch64-linux-gnu, alpha-linux-gnu, arm-linux-gnueabi, i386-linux-gnu, ia64-linux-gnu, m68k-linux-gnu, microblaze-linux-gnu [1], mips{64}-linux-gnu, nios2-linux-gnu, powerpc{64le}-linux-gnu, s390{x}-linux-gnu, sparc{64}-linux-gnu, and x86_64-linux-gnu). Also ran a full check on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, arm-linux-gnueabhf, and powerpc64le-linux-gnu. [BZ #14092] * conform/Makefile (conformtest-headers-ISO11): Add threads.h. (linknamespace-libs-ISO11): Add libpthread.a. * conform/data/threads.h-data: New file: add C11 thrd_* types and functions. * include/stdc-predef.h (__STDC_NO_THREADS__): Remove definition. * nptl/Makefile (headers): Add threads.h. (libpthread-routines): Add new C11 thread thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, and thrd_yield. * nptl/Versions (libpthread) [GLIBC_2.28]): Add new C11 thread thrd_create, thrd_current, thrd_detach, thrd_equal, thrd_exit, thrd_join, thrd_sleep, and thrd_yield symbols. * nptl/descr.h (struct pthread): Add c11 field. * nptl/pthreadP.h (ATTR_C11_THREAD): New define. * nptl/pthread_create.c (START_THREAD_DEFN): Call C11 thread start routine with expected function prototype. (__pthread_create_2_1): Add C11 threads check based on attribute value. * sysdeps/unix/sysdep.h (INTERNAL_SYSCALL_CANCEL): New macro. * nptl/thrd_create.c: New file. * nptl/thrd_current.c: Likewise. * nptl/thrd_detach.c: Likewise. * nptl/thrd_equal.c: Likewise. * nptl/thrd_exit.c: Likewise. * nptl/thrd_join.c: Likewise. * nptl/thrd_priv.h: Likewise. * nptl/thrd_sleep.c: Likewise. * nptl/thrd_yield.c: Likewise. * include/threads.h: Likewise.
2018-07-24Add <bits/indirect-return.h>H.J. Lu
Add <bits/indirect-return.h> and include it in <ucontext.h>. __INDIRECT_RETURN defined in <bits/indirect-return.h> indicates if swapcontext requires special compiler treatment. The default __INDIRECT_RETURN is empty. On x86, when shadow stack is enabled, __INDIRECT_RETURN is defined with indirect_return attribute, which has been added to GCC 9, to indicate that swapcontext returns via indirect branch. Otherwise __INDIRECT_RETURN is defined with returns_twice attribute. When shadow stack is enabled, remove always_inline attribute from prepare_test_buffer in string/tst-xbzero-opt.c to avoid: tst-xbzero-opt.c: In function ‘prepare_test_buffer’: tst-xbzero-opt.c:105:1: error: function ‘prepare_test_buffer’ can never be inlined because it uses setjmp prepare_test_buffer (unsigned char *buf) when indirect_return attribute isn't available. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * bits/indirect-return.h: New file. * misc/sys/cdefs.h (__glibc_has_attribute): New. * sysdeps/x86/bits/indirect-return.h: Likewise. * stdlib/Makefile (headers): Add bits/indirect-return.h. * stdlib/ucontext.h: Include <bits/indirect-return.h>. (swapcontext): Add __INDIRECT_RETURN. * string/tst-xbzero-opt.c (ALWAYS_INLINE): New. (prepare_test_buffer): Use it.
2018-07-24Fix out-of-bounds access in IBM-1390 converter (bug 23448)Andreas Schwab
The IBM-1390 converter can consume/produce two UCS4 characters in each loop.
2018-07-24x86: Update vfork to pop shadow stackH.J. Lu
The shadow stack prevents us from pushing the saved return PC onto the stack and returning normally. Instead we pop the shadow stack and return directly. This is the safest way to return and ensures any stack manipulations done by the vfork'd child doesn't cause the parent to terminate when CET is enabled. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * sysdeps/unix/sysv/linux/i386/vfork.S (SYSCALL_ERROR_HANDLER): Redefine if shadow stack is enabled. (SYSCALL_ERROR_LABEL): Likewise. (__vfork): Pop shadow stack and jump back to to caller directly when shadow stack is in use. * sysdeps/unix/sysv/linux/x86_64/vfork.S (SYSCALL_ERROR_HANDLER): Redefine if shadow stack is enabled. (SYSCALL_ERROR_LABEL): Likewise. (__vfork): Pop shadow stack and jump back to to caller directly when shadow stack is in use.
2018-07-24x86-64: Add endbr64 to tst-quadmod[12].SH.J. Lu
Add endbr64 to tst-quadmod1.S and tst-quadmod2.S so that func and foo can be called indirectly. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * sysdeps/x86_64/tst-quadmod1.S (func): Add endbr64 if IBT is enabled. (foo): Likewise. * sysdeps/x86_64/tst-quadmod2.S (func) : Likewise. (foo): Likewise.
2018-07-20Use binutils 2.31 branch in build-many-glibcs.py.Joseph Myers
* scripts/build-many-glibcs.py (Context.checkout): Default binutils version to 2.31 branch.
2018-07-20Change URL of gcc's tarballZong Li
After 7.1.0 version, there is no .bz2 format of gcc's tarball. * scripts/build-many-glibcs.py (Context.checkout_tar): Change the URL of gcc's tarball.
2018-07-20regcomp: Fix off-by-one bug in build_equiv_class [BZ #23396]Florian Weimer
This bug is very similar to bug 23036: The existing code assumed that the length count included the length byte itself. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-07-20check-execstack: Permit sysdeps to xfail some libsSamuel Thibault
* scripts/check-execstack.awk: Consider `xfail' variable containing a list of libraries whose stack executability is expected. * elf/Makefile ($(objpfx)check-execstack.out): Pass $(check-execstack-xfail) to check-execstack.awk through `xfail' variable. * sysdeps/mach/hurd/i386/Makefile (check-execstack-xfail): Set to ld.so libc.so libpthread.so.
2018-07-20hurd: Fix installed-headers testsSamuel Thibault
* sysdeps/mach/include/mach-shortcuts-hidden.h [!_ISOMAC]: Do not declare libc hidden prototypes. * sysdeps/mach/include/mach/mach_traps.h [!_ISOMAC]: Likewise.
2018-07-20Fix new file headerSamuel Thibault
2018-07-20hurd: Implement pipe2Thomas Schwinge
* sysdeps/mach/hurd/pipe2.c: New file, copy from pipe.c. Evolve it to implement __pipe2. * sysdeps/mach/hurd/pipe.c (__pipe): Reimplement using __pipe2.
2018-07-20hurd: SOCK_CLOEXEC and SOCK_NONBLOCK for socketpairThomas Schwinge
* sysdeps/mach/hurd/socketpair.c (__socketpair): Handle SOCK_CLOEXEC and SOCK_NONBLOCK.
2018-07-20hurd: SOCK_CLOEXEC and SOCK_NONBLOCK for socketThomas Schwinge
* sysdeps/mach/hurd/socket.c (__socket): Handle SOCK_CLOEXEC and SOCK_NONBLOCK.
2018-07-20hurd: Enable thread-safe i386 atomic instructionsSamuel Thibault
* sysdeps/mach/hurd/i386/tls.h (_hurd_tls_init): Set multiple_threads to 1.
2018-07-19benchtests: improve argument parsing through argparse libraryLeonardo Sandoval
The argparse library is used on compare_bench script to improve command line argument parsing. The 'schema validation file' is now optional, reducing by one the number of required parameters. * benchtests/scripts/compare_bench.py (__main__): use the argparse library to improve command line parsing. (__main__): make schema file as optional parameter (--schema), defaulting to benchtests/scripts/benchout.schema.json. (main): move out of the parsing stuff to __main_  and leave it only as caller of main comparison functions.
2018-07-19INSTALL: Add a note for Intel CET statusH.J. Lu
* NEWS: Add a note for Intel CET status. * manual/install.texi: Likewise. * INSTALL: Regenerated.
2018-07-18oc_FR locale: Multiple updates (bug 23140, bug 23422).Quentin PAGÈS
Multiple updates for Occitan language including alternative month names, update abday and abmon, fix typos in day, fix d_fmt, correct LC_NAME, and use “copy "ca_ES"” as LC_COLLATE. [BZ #23140] * localedata/locales/oc_FR (mon): Rename to... (alt_mon): This, then update October (typo fix). (mon): New content (genitive case, month names preceded by "de" or "d’"). [BZ #23422] * localedata/locales/oc_FR (abday): Update all items. (day): Update Wednesday and Saturday (typo fixes). (abmon): Update all items, except May. (d_fmt): Update "%d.%m.%Y" -> "%d/%m/%Y". (LC_IDENTIFICATION): Bump the revision number and date. Keep the "category" entries in alphabetic order. (LC_ADDRESS): Remove no longer needed comment. (LC_COLLATE): Use “copy "ca_ES"”. (LC_NAME): Set the correct values of "name_fmt", "name_mr", and "name_mrs". Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-07-18Avoid insecure usage of tmpnam in tests.Joseph Myers
Various glibc testcases use tmpnam in ways subject to race conditions (generate a temporary file name, then later open that file without O_EXCL). This patch fixes those tests to use mkstemp - generally a minimal local fix to use mkstemp instead of tmpnam, rather than a larger fix to use other testsuite infrastructure for temporary files. The unchanged use of tmpnam in posix/wordexp-test.c would fail safe in the event of a race (it's generating a name for use with mkdir rather than for a file to be opened for writing). Tested for x86_64. * grp/tst_fgetgrent.c: Include <unistd.h>. (main): Use mkstemp instead of tmpnam. * io/test-utime.c (main): Likewise. * posix/annexc.c (macrofile): Change to modifiable array. (get_null_defines): Use mkstemp instead of tmpnam. Do not remove macrofile here. * posix/bug-getopt1.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt2.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt3.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt4.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt5.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * stdio-common/bug7.c: Include <stdlib.h> and <unistd.h>. (main): Use mkstemp instead of tmpnam. * stdio-common/tst-fdopen.c: Include <stdlib.h>. (main): Use mkstemp instead of tmpnam. * stdio-common/tst-ungetc.c: Include <stdlib.h>. (main): use mkstemp instead of tmpnam. * stdlib/isomac.c (macrofile): Change to modifiable array. (get_null_defines): Use mkstemp instead of tmpnam. Do not remove macrofile here.
2018-07-18x86/CET: Document glibc.tune.x86_ibt and glibc.tune.x86_shstkH.J. Lu
* manual/tunables.texi: Document glibc.tune.x86_ibt and glibc.tune.x86_shstk.
2018-07-18Intel CET: Document --enable-cetH.J. Lu
* NEWS: Mention --enable-cet. * manual/install.texi: Document --enable-cet. * INSTALL: Regenerated.
2018-07-18x86-64: Use _CET_NOTRACK in memcmp-sse4.SH.J. Lu
* sysdeps/x86_64/multiarch/memcmp-sse4.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in memset-sse2-rep.SH.J. Lu
* sysdeps/i386/i686/multiarch/memset-sse2-rep.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in strcat-sse2.SH.J. Lu
* sysdeps/i386/i686/multiarch/strcat-sse2.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in strcpy-sse2.SH.J. Lu
* sysdeps/i386/i686/multiarch/strcpy-sse2.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in memcpy-ssse3.SH.J. Lu
* sysdeps/i386/i686/multiarch/memcpy-ssse3.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in memcpy-ssse3-rep.SH.J. Lu
* sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table. (BRANCH_TO_JMPTBL_ENTRY_TAIL): Likewise.
2018-07-18i386: Use _CET_NOTRACK in memcmp-sse4.SH.J. Lu
* sysdeps/i386/i686/multiarch/memcmp-sse4.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in memset-sse2.SH.J. Lu
* sysdeps/i386/i686/multiarch/memset-sse2.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18i386: Use _CET_NOTRACK in i686/memcmp.SH.J. Lu
* sysdeps/i386/i686/memcmp.S (memcmp): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18x86-64: Use _CET_NOTRACK in memcpy-ssse3.SH.J. Lu
* sysdeps/x86_64/multiarch/memcpy-ssse3.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table. (MEMCPY): Likewise.
2018-07-18x86-64: Use _CET_NOTRACK in memcpy-ssse3-back.SH.J. Lu
* sysdeps/x86_64/multiarch/memcpy-ssse3-back.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table. (MEMCPY): Likewise.
2018-07-18x86-64: Use _CET_NOTRACK in strcmp-sse42.SH.J. Lu
* sysdeps/x86_64/multiarch/strcmp-sse42.S (STRCMP_SSE42): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18x86-64: Use _CET_NOTRACK in strcpy-sse2-unaligned.SH.J. Lu
* sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S (BRANCH_TO_JMPTBL_ENTRY): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18x86_64: Use _CET_NOTRACK in strcmp.SH.J. Lu
* sysdeps/x86_64/strcmp.S (STRCMP): Add _CET_NOTRACK before indirect jump to jump table.
2018-07-18New locale: Yakut (Sakha) for Russia (sah_RU) [BZ #22241]Valery Timiriliyev
* localedata/Makefile (test-input): Add sah_RU.UTF-8. (LOCALES): Likewise. * localedata/SUPPORTED (sah_RU/UTF-8): New entry. * localedata/locales/sah_RU: New file. * localedata/sah_RU.UTF-8.in: New file. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-07-17i386: Add _CET_ENDBR to indirect jump targets in add_n.S/sub_n.SH.J. Lu
i386 add_n.S and sub_n.S use a trick to implment jump tables with LEA. We can't use conditional branches nor normal jump tables since jump table entries use EFLAGS set by jump table index. This patch adds _CET_ENDBR to indirect jump targets and adjust destination for _CET_ENDBR. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * sysdeps/i386/add_n.S: Include <sysdep.h>, instead of "sysdep.h". (__mpn_add_n): Save and restore %ebx if IBT is enabed. Add _CET_ENDBR to indirect jump targets and adjust jump destination for _CET_ENDBR. * sysdeps/i386/i686/add_n.S: Include <sysdep.h>, instead of "sysdep.h". (__mpn_add_n): Save and restore %ebx if IBT is enabed. Add _CET_ENDBR to indirect jump targets and adjust jump destination for _CET_ENDBR. * sysdeps/i386/sub_n.S: Include <sysdep.h>, instead of "sysdep.h". (__mpn_sub_n): Save and restore %ebx if IBT is enabed. Add _CET_ENDBR to indirect jump targets and adjust jump destination for _CET_ENDBR.