about summary refs log tree commit diff
path: root/sysdeps
Commit message (Collapse)AuthorAgeFilesLines
* y2038: linux: Provide __timerfd_settime64 implementationLukasz Majewski2020-02-023-2/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces auto generated wrapper (as described in sysdeps/unix/sysv/linux/syscalls.list) for timerfd_settime with one which adds extra support for reading and writing from Linux kernel 64 bit time values on machines with __TIMESIZE != 64. There is no functional change for archs already supporting 64 bit time ABI. This patch is conceptually identical to timer_settime conversion already done in sysdeps/unix/sysv/linux/timer_settime.c. Please refer to corresponding commit message for detailed description of introduced functions and the testing procedure. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> --- Changes for v4: - Update date from 2019 to 2020 Changes for v3: - Add missing libc_hidden_def() Changes for v2: - Remove "Contributed by" from the file header - Remove early check for (fd < 0) in __timerfd_settime64 as the fd correctness check is already done in Linux kernel - Add single descriptive comment line to provide concise explanation of the code
* y2038: linux: Provide __timerfd_gettime64 implementationLukasz Majewski2020-02-023-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces auto generated wrapper (as described in sysdeps/unix/sysv/linux/syscalls.list) for timerfd_gettime with one which adds extra support for reading 64 bit time values on machines with __TIMESIZE != 64. There is no functional change for architectures already supporting 64 bit time ABI. This patch is conceptually identical to timer_gettime conversion already done in sysdeps/unix/sysv/linux/timer_gettime.c. Please refer to corresponding commit message for detailed description of introduced functions and the testing procedure. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> --- Changes for v4: - Update date from 2019 to 2020 Changes for v3: - Add missing libc_hidden_def() Changes for v2: - Remove "Contributed by" from the file header - Remove early check for (fd < 0) in __timerfd_gettime64 as the fd correctness check is already done in Linux kernel - Add single descriptive comment line to provide concise explanation of the code
* i386: Remove _exit.SH.J. Lu2020-02-011-44/+0
| | | | | | | The generic implementation is suffice since __NR_exit_group is always support and i386 does define ABORT_INSTRUCTION. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386: Use ENTRY/END in assembly codesH.J. Lu2020-02-013-15/+10
| | | | | | | Use ENTRY and END in assembly codes so that ENDBR32 will be added at function entries when CET is enabled. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386-mcount.S: Add _CET_ENDBR to _mcount and __fentry__H.J. Lu2020-02-011-0/+2
| | | | | | | Since _mcount and __fentry__ don't use ENTRY, we need to add _CET_ENDBR by hand. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386/sub_n.S: Add a missing _CET_ENDBR to indirect jump targetH.J. Lu2020-02-011-0/+1
| | | | | | Add a missing _CET_ENDBR to indirect jump targe in sysdeps/i386/sub_n.S. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* i386: Don't unnecessarily save and restore EAX, ECX and EDX [BZ# 25262]H.J. Lu2020-02-014-29/+10
| | | | | | | | | | | On i386, since EAX, ECX and EDX are caller-saved, there are no need to save and restore EAX, ECX and EDX in getcontext, setcontext and swapcontext. They just need to clear EAX on success. The extra scratch registers are needed to enable CET. Tested on i386. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* x86: Don't make 2 calls to dlerror () in a rowH.J. Lu2020-02-012-2/+2
| | | | | | | | | | We shouldn't make 2 calls to dlerror () in a row since the first call will clear the error. We should just use the return value from the first call. Tested on Linux/x86-64. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* nptl: Avoid using PTHREAD_MUTEX_DEFAULT in macro definition [BZ #25271]Florian Weimer2020-01-301-1/+1
| | | | | | | | | | | | | | | | | | | Commit 1c3f9acf1f1f75faa7a28bf39af64afd ("nptl: Add struct_mutex.h") replaced a zero constant with the identifier PTHREAD_MUTEX_DEFAULT in the macro PTHREAD_MUTEX_INITIALIZER. However, that constant is not available in ISO C11 mode: In file included from /usr/include/bits/thread-shared-types.h:74, from /usr/include/bits/pthreadtypes.h:23, from /usr/include/pthread.h:26, from bug25271.c:1: bug25271.c:3:21: error: ‘PTHREAD_MUTEX_DEFAULT’ undeclared here (not in a function) 3 | pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; | ^~~~~~~~~~~~~~~~~~~~~~~~~ This commit change the constant to the equivalent PTHREAD_MUTEX_TIMED_NP, which is in the POSIX extension namespace and thus always available.
* Fix array overflow in backtrace on PowerPC (bug 25423)Andreas Schwab2020-01-212-0/+4
| | | | | | When unwinding through a signal frame the backtrace function on PowerPC didn't check array bounds when storing the frame address. Fixes commit d400dcac5e ("PowerPC: fix backtrace to handle signal trampolines").
* getaddrinfo: Fix resource leak after strdup failure in gethosts [BZ #25425]Florian Weimer2020-01-201-0/+1
| | | | | | | | | | | | Filip Ochnik spotted that one of the error jumps in gethosts fails to call __resolv_context_put to release the resolver context. Fixes commit 352f4ff9a268b81ef5d4b2413f582565806e4790 ("resolv: Introduce struct resolv_context [BZ #21668]") and commit 964263bb8d650f1681665c55704fb01a8e725621 ("getaddrinfo: Release resolver context on error in gethosts [BZ #21885]"). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Fix maybe-uninitialized error on powerpcMatheus Castanho2020-01-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | The build has been failing on powerpc64le-linux-gnu with GCC 10 due to a maybe-uninitialized error: ../sysdeps/ieee754/dbl-64/mpa.c:875:6: error: ‘w.e’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 875 | EY -= EX; | ^~ The warning is thrown because when __inv is called by __dvd *y is not initialized and if t == 0 before calling __dbl_mp, EY will stay uninitialized, as the function does not touch it in this case. However, since t will be set to 1/t before calling __dbl_mp, t == 0 will never happen, so we can instruct the compiler to ignore this case, which suppresses the warning. Tested on powerpc64le. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* powerpc32: Fix syntax error in __GLRO macroAndreas Schwab2020-01-181-1/+1
|
* Fix tst-pkey.c pkey_alloc return checks and manualLucas A. M. Magalhaes2020-01-171-0/+4
| | | | | | | | | | | | This test was failing in some powerpc systems as it was not checking for ENOSPC return. As said on the Linux man-pages and can be observed by the implementation at mm/mprotect.c in the Linux Kernel source. The syscall pkey_alloc can return EINVAL or ENOSPC. ENOSPC will indicate either that all keys are in use or that the kernel does not support pkeys. Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.net.br>
* powerpc: Move cache line size to rtld_global_roTulio Magno Quites Machado Filho2020-01-1718-63/+310
| | | | | | | | | | | | | | GCC 10.0 enabled -fno-common by default and this started to point that __cache_line_size had been implemented in 2 different places: loader and libc. In order to avoid this duplication, the libc variable has been removed and the loader variable is moved to rtld_global_ro. File sysdeps/unix/sysv/linux/powerpc/dl-auxv.h has been added in order to reuse code for both static and dynamic linking scenarios. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* powerpc: Initialize rtld_global_ro for static dlopen [BZ #20802]Tulio Magno Quites Machado Filho2020-01-171-2/+11
| | | | | | | Initialize dl_auxv, dl_hwcap and dl_hwcap2 in rtld_global_ro for DSOs that have been statically dlopen'ed. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* htl: Add internal version of __pthread_mutex_timedlockSamuel Thibault2020-01-133-2/+6
| | | | The C11 threads implementation will need it.
* htl: Avoid exposing unixoid functionsSamuel Thibault2020-01-133-2/+5
| | | | C11 threads should not expose them.
* htl: Add type sizes in bits/pthreadtypes-arch.h and check themSamuel Thibault2020-01-1314-0/+42
|
* htl: Add internal versions of functions used by C11 threadsSamuel Thibault2020-01-133-1/+5
| | | | | The C11 threads implementation needs to call pthread_join and pthread_key_delete without exposing them.
* MIPS: Fix circular definition of __LDBL_MANT_DIG__ in ieee754.hZack Weinberg2020-01-081-1/+1
| | | | | | | | | | | | | | | In commit aa706e13f4bfdf32a27c498902edf4f6006e433e, sysdeps/mips/ieee754/ieee754.h was changed to use GCC’s predefined macro __LDBL_MANT_DIG__, instead of including <float.h> and using LDBL_MANT_DIG (and therefore polluting the user namespace with all of the macros defined in float.h). In order to support compilers that don’t provide __LDBL_MANT_DIG__, there is a fallback #if block which was supposed to include <float.h> and then define __LDBL_MANT_DIG__ to LDBL_MANT_DIG. However, at some point during the development of the patch, a typo was introduced, causing the fallback block to define __LDBL_MANT_DIG__ to expand to __LDBL_MANT_DIG__. Correct this typo.
* hurd: Fix message reception for timer_threadSamuel Thibault2020-01-051-1/+2
| | | | | | | Without a proper size, we get MACH_RCV_TOO_LARGE instead of MACH_MSG_SUCCESS. * sysdeps/mach/hurd/setitimer.c (timer_thread): Add return_code_type field to received message, and set the receive size in __mach_msg call.
* htl: Add __errno_location and __h_errno_locationSamuel Thibault2020-01-042-0/+6
| | | | | | | | As explained on https://sourceware.org/ml/libc-alpha/2020-01/msg00049.html the presence of __errno_location in libpthread.so on GNU/Linux makes libpthread getting linked in for libstdc++. This aligns on that behavior, to avoid issues that only GNU/Hurd would get.
* htl: Move pthread_atfork to libc_nonshared.aSamuel Thibault2020-01-042-3/+3
| | | | | | | | | | | | | | | This follows bd60ce86520b ('nptl: Move pthread_atfork to libc_nonshared.a') with the same rationale: there is no non-libpthread equivalent to be used for making linking against libpthread optional. libpthread_nonshared.a is unused after this, so remove it from the build. There is no ABI impact because pthread_atfork was implemented using __register_atfork in libc even before this change. pthread_atfork has to be a weak alias because pthread_* names are not reserved in libc.
* htl: Use dso_handle.hSamuel Thibault2020-01-041-5/+2
|
* linux: Optimize fallback 32-bit clock_getresAdhemerval Zanella2020-01-031-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | This patch avoid probing the __NR_clock_getttime64 syscall each time __clock_gettime64 is issued on a kernel without 64 bit time support. Once ENOSYS is obtained, only 32-bit clock_gettime are used. The following snippet: clock_getres (CLOCK_REALTIME, &(struct timespec) { 0 }); clock_getres (CLOCK_MONOTONIC, &(struct timespec) { 0 }); clock_getres (CLOCK_BOOTTIME, &(struct timespec) { 0 }); clock_getres (20, &(struct timespec) { 0 }); On a kernel without 64 bit time support issues the syscalls: syscall_0x196(0, 0xffb83330, [...]) = -1 ENOSYS (Function not implemented) clock_getres(CLOCK_REALTIME, {tv_sec=0, tv_nsec=1}) = 0 clock_getres(CLOCK_MONOTONIC, {tv_sec=0, tv_nsec=1}) = 0 clock_getres(CLOCK_BOOTTIME, {tv_sec=0, tv_nsec=1}) = 0 Checked on i686-linux-gnu on 4.15 kernel. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Add support for clock_getres64 vDSOAdhemerval Zanella2020-01-038-12/+24
| | | | | | | | No architecture currently defines the vDSO symbol. On archictures with 64-bit time_t the HAVE_CLOCK_GETRES_VSYSCALL is renamed to HAVE_CLOCK_GETRES64_VSYSCALL, it simplifies clock_gettime code. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Enable vDSO clock_gettime64 for mipsAdhemerval Zanella2020-01-031-0/+5
| | | | | | It was added on Linux 5.4 (commit 1f66c45db3302). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Enable vDSO clock_gettime64 for armAdhemerval Zanella2020-01-031-0/+1
| | | | | | It was added on Linux 5.5 (commit 74d06efb9c2f9). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Enable vDSO clock_gettime64 for i386Adhemerval Zanella2020-01-031-0/+1
| | | | | | | | It was added on Linux 5.3 (commit 22ca962288c0a). Checked on i686-linux-gnu with 5.3.0 kernel. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Optimize fallback 32-bit clock_gettimeAdhemerval Zanella2020-01-031-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch avoid probing the __NR_clock_getttime64 syscall each time __clock_gettime64 is issued on a kernel without 64 bit time support. Once ENOSYS is obtained, only 32-bit clock_gettime are used. The following snippet: clock_gettime (CLOCK_REALTIME, &(struct timespec) { 0 }); clock_gettime (CLOCK_MONOTONIC, &(struct timespec) { 0 }); clock_gettime (CLOCK_BOOTTIME, &(struct timespec) { 0 }); clock_gettime (20, &(struct timespec) { 0 }); On a kernel without 64 bit time support and with vDSO support results on the following syscalls: syscall_0x193(0, 0xff87ba30, [...]) = -1 ENOSYS (Function not implemented) clock_gettime(CLOCK_BOOTTIME, {tv_sec=927082, tv_nsec=474382032}) = 0 clock_gettime(0x14 /* CLOCK_??? */, 0xff87b9f8) = -1 EINVAL (Invalid argument) While on a kernel without vDSO support: syscall_0x193(0, 0xbec95550, 0xb6ed2000, 0x1, 0xbec95550, 0) = -1 (errno 38) clock_gettime(CLOCK_REALTIME, {tv_sec=1576615930, tv_nsec=638250162}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=1665478, tv_nsec=638779620}) = 0 clock_gettime(CLOCK_BOOTTIME, {tv_sec=1675418, tv_nsec=292932704}) = 0 clock_gettime(0x14 /* CLOCK_??? */, 0xbec95530) = -1 EINVAL (Invalid argument) Checked on i686-linux-gnu on 4.15 kernel and on a 5.3 kernel. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Add support for clock_gettime64 vDSOAdhemerval Zanella2020-01-039-12/+34
| | | | | | | | No architecture currently defines the vDSO symbol. On architectures with 64-bit time_t the HAVE_CLOCK_GETTIME_VSYSCALL is renamed to HAVE_CLOCK_GETTIME64_VSYSCALL, it simplifies clock_gettime code. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* elf: Move vDSO setup to rtld (BZ#24967)Adhemerval Zanella2020-01-0327-284/+239
| | | | | | | | | | | | | | | | | | | | | | | | This patch moves the vDSO setup from libc to loader code, just after the vDSO link_map setup. For static case the initialization is moved to _dl_non_dynamic_init instead. Instead of using the mangled pointer, the vDSO data is set as attribute_relro (on _rtld_global_ro for shared or _dl_vdso_* for static). It is read-only even with partial relro. It fixes BZ#24967 now that the vDSO pointer is setup earlier than malloc interposition is called. Also, vDSO calls should not be a problem for static dlopen as indicated by BZ#20802. The vDSO pointer would be zero-initialized and the syscall will be issued instead. Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabihf, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu, s390x-linux-gnu, sparc64-linux-gnu, and sparcv9-linux-gnu. I also run some tests on mips. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Consolidate time implementationAdhemerval Zanella2020-01-033-55/+54
| | | | | | | | | | | The IFUNC bypass to vDSO is used when USE_IFUNC_TIME is set. Currently powerpc and x86 defines it. Otherwise the generic implementation is used, which calls clock_gettime. Checked on powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu-power4, x86_64-linux-gnu, and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Consolidate Linux gettimeofdayAdhemerval Zanella2020-01-034-100/+63
| | | | | | | | | | | | The IFUNC bypass to vDSO is used when USE_IFUNC_GETTIMEOFDAY is set. Currently aarch64, powerpc*, and x86 defines it. Otherwise the generic implementation is used, which calls clock_gettime. Checked on aarch64-linux-gnu, powerpc64le-linux-gnu, powerpc64-linux-gnu, powerpc-linux-gnu-power4, x86_64-linux-gnu, and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Update mips vDSO symbolsAdhemerval Zanella2020-01-031-0/+1
| | | | | | | | | The clock_getres is a new implementation added on Linux 5.4 (abed3d826f2f). Checked with a build against mips-linux-gnu and mips64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Update x86 vDSO symbolsAdhemerval Zanella2020-01-033-4/+4
| | | | | | | | | | | | | Add the missing time and clock_getres vDSO symbol names on x86. For time, the iFUNC already uses expected name so it affects only the static build. The clock_getres is a new implementation added on Linux 5.3 (f66501dc53e72). Checked on x86-linux-gnu and i686-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Remove vDSO support from make-syscall.shAdhemerval Zanella2020-01-031-44/+1
| | | | | | | | | | | | | | | | | The auto-generated vDSO call shows some issues: - It requires sync the auto-generated C file with current glibc implementation; - It still uses symbol redirections hacks where libc-symbols.h provide macros that uses compiler builtins (libc_ifunc_redirected for instance); - It does not handle all required compiler handling (inhibit_stack_protector on iFUNC resolver). - No architecure uses it. Checked with a build against all major ABIs. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* x86: Make x32 use x86 time implementationAdhemerval Zanella2020-01-032-2/+0
| | | | | | | | | | This is the only use of auto-generation syscall which uses a vDSO plus IFUNC and the current x86 generic implementation already covers the expected semantic. Checked on x86_64-linux-gnu-x32. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* linux: Fix vDSO macros build with time64 interfacesAdhemerval Zanella2020-01-0310-98/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As indicated on libc-help [1] the ec138c67cb commit broke 32-bit builds when configured with --enable-kernel=5.1 or higher. The scenario 10 from [2] might also occur in this configuration and INLINE_VSYSCALL will try to use the vDSO symbol and HAVE_CLOCK_GETTIME64_VSYSCALL does not set HAVE_VSYSCALL prior its usage. Also, there is no easy way to just enable the code to use one vDSO symbol since the macro INLINE_VSYSCALL is redefined if HAVE_VSYSCALL is set. Instead of adding more pre-processor handling and making the code even more convoluted, this patch removes the requirement of defining HAVE_VSYSCALL before including sysdep-vdso.h to enable vDSO usage. The INLINE_VSYSCALL is now expected to be issued inside a HAVE_*_VSYSCALL check, since it will try to use the internal vDSO pointers. Both clock_getres and clock_gettime vDSO code for time64_t were removed since there is no vDSO setup code for the symbol (an architecture can not set HAVE_CLOCK_GETTIME64_VSYSCALL). Checked on i686-linux-gnu (default and with --enable-kernel=5.1), x86_64-linux-gnu, aarch64-linux-gnu, and powerpc64le-linux-gnu. I also checked against a build to mips64-linux-gnu and sparc64-linux-gnu. [1] https://sourceware.org/ml/libc-help/2019-12/msg00014.html [2] https://sourceware.org/ml/libc-alpha/2019-12/msg00142.html Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Linux: Fix clock_nanosleep time64 checkAdhemerval Zanella2020-01-031-8/+12
| | | | | | | | The result of INTERNAL_SYSCALL_CANCEL should be checked with macros INTERNAL_SYSCALL_ERROR_P and INTERNAL_SYSCALL_ERRNO instead of comparing the result directly. Checked on powerpc-linux-gnu.
* Add libm_alias_finite for _finite symbolsWilco Dijkstra2020-01-03257-341/+593
| | | | | | | | | | | | | | | | | | | This patch adds a new macro, libm_alias_finite, to define all _finite symbol. It sets all _finite symbol as compat symbol based on its first version (obtained from the definition at built generated first-versions.h). The <fn>f128_finite symbols were introduced in GLIBC 2.26 and so need special treatment in code that is shared between long double and float128. It is done by adding a list, similar to internal symbol redifinition, on sysdeps/ieee754/float128/float128_private.h. Alpha also needs some tricky changes to ensure we still emit 2 compat symbols for sqrt(f). Passes buildmanyglibc. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Linux: Remove pread/pread64, pwrite/pwrite64 kludges from <sysdep.h>Florian Weimer2020-01-024-40/+0
| | | | | | Since the switch away from auto-generated wrappers for these system calls, the kludge is already included in the C source file of the system call wrapper.
* Linux: Use system call tables during buildFlorian Weimer2020-01-0220-57/+44
| | | | | | | | | | | | | | | | | | | | | | | Use <arch-syscall.h> instead of <asm/unistd.h> to obtain the system call numbers. A few direct includes of <asm/unistd.h> need to be removed (if the system call numbers are already provided indirectly by <sysdep.h>) or replaced with <sys/syscall.h>. Current Linux headers for alpha define the required system call names, so most of the _NR_* hacks are no longer needed. For the 32-bit arm architecture, eliminate the INTERNAL_SYSCALL_ARM macro, now that we have regular system call names for cacheflush and set_tls. There are more such cleanup opportunities for other architectures, but these cleanups are required to avoid macro redefinition errors during the build. For ia64, it is desirable to use <asm/break.h> directly to obtain the break number for system calls (which is not a system call number itself). This requires replacing __BREAK_SYSCALL with __IA64_BREAK_SYSCALL because the former is defined as an alias in <asm/unistd.h>, but not in <asm/break.h>. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Linux: Add tables with system call numbersFlorian Weimer2020-01-0230-22/+9050
| | | | | | | | | | | | | | | | | | | | | | | | | | | The new tables are currently only used for consistency checks with the installed kernel headers and the architecture-independent system call names table. They are based on Linux 5.4. The goal is to use these architecture-specific tables to ensure that system call wrappers are available irrespective of the version of the installed kernel headers. The tables are formatted in the form of C header files so that they can be used directly in an #include directive, without external preprocessing. (External preprocessing of a plain table file would introduce cross-subdirectory dependency issues.) However, the intent is that they can still be treated as tables and can be processed by simple tools. The irregular system call names on 32-bit arm add a complication. The <fixup-asm-unistd.h> header is introduced to work around that, and the system calls are listed under regular names in the <arch-syscall.h> file. A make target, update-syscalls-list, is added to patch the glibc sources with data from the current kernel headers. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Update copyright dates not handled by scripts/update-copyrights.Joseph Myers2020-01-012-2/+2
| | | | | | | | | | | | | | | I've updated copyright dates in glibc for 2020. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files. As well as the usual annual updates, mainly dates in --version output (minus libc.texinfo which previously had to be handled manually but is now successfully updated by update-copyrights), there is a fix to sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h where a typo in the copyright notice meant it failed to be updated automatically. Please remember to include 2020 in the dates for any new files added in future (which means updating any existing uncommitted patches you have that add new files to use the new copyright dates in them).
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-015866-5866/+5866
|
* alpha: Set wait4 as cancellation entrypointAdhemerval Zanella2019-12-302-1/+26
| | | | | | | Since both wait and waitpid are implemented on top of wait4. It fixes nptl/tst-cancel{x}{4,5,7}. Checked on alpha-linux-gnu.
* hurd: Global signal dispositionJeremie Koenig2019-12-2914-55/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds _hurd_sigstate_set_global_rcv used by libpthread to enable POSIX-confirming behavior of signals on a per-thread basis. This also provides a sigstate destructor _hurd_sigstate_delete, and a global process signal state, which needs to be locked and check when global disposition is enabled, thus the addition of _hurd_sigstate_lock _hurd_sigstate_actions _hurd_sigstate_pending _hurd_sigstate_unlock helpers. This also updates all the glibc code accordingly. This also drops support for get_int(INIT_SIGMASK), which did not make sense any more since we do not have a single signal thread any more. During fork/spawn, this also reinitializes the child global sigstate's lock. That cures an issue that would very rarely cause a deadlock in the child in fork, tries to unlock ss' critical section lock at the end of fork. This will typically (always?) be observed in /bin/sh, which is not surprising as that is the foremost caller of fork. To reproduce an intermediate state, add an endless loop if _hurd_global_sigstate is locked after __proc_dostop (cast through volatile); that is, while still being in the fork's parent process. When that triggers (use the libtool testsuite), the signal thread has already locked ss (which is _hurd_global_sigstate), and is stuck at hurdsig.c:685 in post_signal, trying to lock _hurd_siglock (which the main thread already has locked and keeps locked until after __task_create). This is the case that ss->thread == MACH_PORT_NULL, that is, a global signal. In the main thread, between __proc_dostop and __task_create is the __thread_abort call on the signal thread which would abort any current kernel operation (but leave ss locked). Later in fork, in the parent, when _hurd_siglock is unlocked in fork, the parent's signal thread can proceed and will unlock eventually the global sigstate. In the client, _hurd_siglock will likewise be unlocked, but the global sigstate never will be, as the client's signal thread has been configured to restart execution from _hurd_msgport_receive. Thus, when the child tries to unlock ss' critical section lock at the end of fork, it will first lock the global sigstate, will spin trying to lock it, which can never be successful, and we get our deadlock. Options seem to be: * Move the locking of _hurd_siglock earlier in post_signal -- but that may generally impact performance, if this locking isn't generally needed anyway? On the other hand, would it actually make sense to wait here until we are not any longer in a critical section (which is meant to disable signal delivery anyway (but not for preempted signals?))? * Clear the global sigstate in the fork's child with the rationale that we're anyway restarting the signal thread from a clean state. This has now been implemented. Why has this problem not been observed before Jérémie's patches? (Or has it? Perhaps even more rarely?) In _S_msg_sig_post, the signal is now posted to a *global receiver thread*, whereas previously it was posted to the *designated signal-receiving thread*. The latter one was in a critical section in fork, so didn't try to handle the signal until after leaving the critical section? (Not completely analyzed and verified.) Another question is what the signal is that is being received during/around the time __proc_dostop executes.
* hurd sendmsg: Fix warning on calling CMSG_*HDRSamuel Thibault2019-12-291-2/+2
|