about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* ldbl-128ibm-compat: PLT redirects for using ldbl redirects internallyPaul E. Murphy2020-03-2517-26/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tweak the PLT bypass magic when building glibc with long double redirects. This is made more difficult by the fact we only get one chance to redirect functions. This happens via the public headers. There are roughly three classes of redirect we need to attend to today: 1. Simple redirects, redirected via cdef macro overrides and and new libc_hidden_ldbl_proto macro. 2. Internal usage of internal API, e.g __snprintf, which has no direct analogue. This is bypassed directly on case-by- case basis. 3. Double redirects, e.g sscanf and related. These require a heavier handed approach of macro renaming to existing symbols. Most simple redirects are handled via 1. Ideally, the libc_* macro would live in libc-symbols.h, but in practice the macros needed for it to do anything useful live in cdefs.h, so they are defined in the local override. Notably, the internal name of the asprintf generated for ieee ldbl redirects is renamed to work with internal prefixed usage. This resolves the local plt usage introduced when building glibc with ldbl == ieee128 on ppc64le. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* stdlib: Move tst-system to tests-containerAdhemerval Zanella2020-03-252-5/+8
| | | | | | Fix some issues with different shell and error messages. Checked on x86_64-linux-gnu and i686-linux-gnu.
* support/shell-container.c: Add builtin killAdhemerval Zanella2020-03-251-0/+25
| | | | | | No options supported. Reviewed-by: DJ Delorie <dj@redhat.com>
* support/shell-container.c: Add builtin exitAdhemerval Zanella2020-03-251-0/+13
| | | | Reviewed-by: DJ Delorie <dj@redhat.com>
* support/shell-container.c: Return 127 if execve failsAdhemerval Zanella2020-03-251-1/+1
| | | | Reviewed-by: DJ Delorie <dj@redhat.com>
* Add NEWS entry for CVE-2020-1751 (bug 25423)Aurelien Jarno2020-03-241-0/+3
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* posix: Fix system error return value [BZ #25715]Adhemerval Zanella2020-03-232-11/+129
| | | | | | | | It fixes 5fb7fc9635 when posix_spawn fails. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* y2038: fix: Add missing libc_hidden_def attribute for some syscall wrappersLukasz Majewski2020-03-235-0/+10
| | | | | | | | | During the conversion to support 64 bit time on some architectures with __WORDSIZE == 32 && __TIMESIZE != 64 the libc_hidden_def attribute for eligible functions was by mistake omitted. This patch fixes this issue and exports (and allows using) those functions when Y2038 support is enabled in glibc.
* Extended Char Intro: Use getwc in example (Bug 25626)Carlos O'Donell2020-03-201-1/+1
| | | | | | | | In the "Extended Char Intro" the example incorrectly uses a function called wgetc which doesn't exist. The example is corrected to use getwc, which is correct for the use in this case. Reported-by: Toomas Rosin <toomas@rosin.ee>
* stdio: Add tests for printf multibyte convertion leak [BZ#25691]Adhemerval Zanella2020-03-202-2/+115
| | | | Checked on x86_64-linux-gnu and i686-linux-gnu.
* stdio: Remove memory leak from multibyte convertion [BZ#25691]Florian Weimer2020-03-201-144/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an updated version of a previous patch [1] with the following changes: - Use compiler overflow builtins on done_add_func function. - Define the scratch +utstring_converted_wide_string using CHAR_T. - Added a testcase and mention the bug report. Both default and wide printf functions might leak memory when manipulate multibyte characters conversion depending of the size of the input (whether __libc_use_alloca trigger or not the fallback heap allocation). This patch fixes it by removing the extra memory allocation on string formatting with conversion parts. The testcase uses input argument size that trigger memory leaks on unpatched code (using a scratch buffer the threashold to use heap allocation is lower). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> [1] https://sourceware.org/pipermail/libc-alpha/2017-June/082098.html
* Add NEWS entry for CVE-2020-1752 (bug 25414)Aurelien Jarno2020-03-191-0/+3
|
* math: Remove inline math testsAdhemerval Zanella2020-03-1964-23645/+7563
| | | | | | | | | | | | | With mathinline removal there is no need to keep building and testing inline math tests. The gen-libm-tests.py support to generate ULP_I_* is removed and all libm-test-ulps files are updated to longer have the i{float,double,ldouble} entries. The support for no-test-inline is also removed from both gen-auto-libm-tests and the auto-libm-test-out-* were regenerated. Checked on x86_64-linux-gnu and i686-linux-gnu.
* Remove __LIBC_INTERNAL_MATH_INLINESAdhemerval Zanella2020-03-193-3/+1
| | | | | | With m68k mathinline.h removal the flag is not used anymore. Checked with a m68k-linux-gnu build/check.
* math: Remove mathinlineAdhemerval Zanella2020-03-193-19/+1
| | | | | With m68k bits moved to internal headers, no architectures export additional optimizations on mathinline.
* m68k: Remove mathinline.hAdhemerval Zanella2020-03-1915-378/+238
| | | | | | | | | | | | | | This is similar to x86 (da75c1b180f9355a) and powerpc (32ea72999693b98e) mathinline.h removal. The required macros to build the fpu routines are moved to mathimpl.h, while the inline optimization macros for atan, tanh, rint, log1p, significand, trunc, floor, ceil, isinf, finite, scalbn, isnan, scalbln, nearbyint, lrint, and sincos are removed. The gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94204 was created to track builtin support. Checked with a build against m68k-linux-gnu, resulting binaries are similar with and without the patch.
* oc_FR locale: Fix spelling of Thursday (bug 25639)Rafał Lużyński2020-03-191-1/+1
| | | | | | As reported by a native speaker: Thursday: "dijóus" -> "dijòus" (also confirmed by CLDR)
* x86: Remove ARCH_CET_LEGACY_BITMAP [BZ #25397]H.J. Lu2020-03-1810-208/+165
| | | | | | | | | | | Since legacy bitmap doesn't cover jitted code generated by legacy JIT engine, it isn't very useful. This patch removes ARCH_CET_LEGACY_BITMAP and treats indirect branch tracking similar to shadow stack by removing legacy bitmap support. Tested on CET Linux/x86-64 and non-CET Linux/x86-64. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix build with GCC 10 when long double = double.Joseph Myers2020-03-171-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | On platforms where long double has the same ABI as double, glibc defines long double functions as aliases for the corresponding double functions. The declarations of those functions in <math.h> are disabled to avoid problems with aliases having incompatible types, but GCC 10 now gives errors for incompatible types when the long double function is known to GCC as a built-in function, not just when there is an incompatible header declaration. This patch fixes those errors by using appropriate -fno-builtin-<function> options to compile the double functions. The list of CFLAGS-* settings is an appropriately adapted version of that in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c files; in particular, the options are used even if GCC does not currently have a built-in function of a given function, so that adding such a built-in function in future will not break the glibc build. Thus, various of the CFLAGS-* settings are only for future-proofing and may not currently be needed (and it's possible some could be irrelevant for other reasons). Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and glibcs builds), where it fixes the build that previously failed.
* nscd/cachedumper.c : fix whitespaceDJ Delorie2020-03-171-4/+4
|
* Fix nscd/cachedumper.c compile errorsDJ Delorie2020-03-161-6/+8
|
* manual: Fix inconsistent declaration of wcsrchr [BZ #24655]Girish Joshi2020-03-131-1/+1
| | | | Reviewed-by: DJ Delorie <dj@redhat.com>
* nscd: add cache dumperDJ Delorie2020-03-134-1/+389
|
* parse_tunables: Fix typo in commentJonathan Wakely2020-03-131-1/+1
|
* ldconfig: trace origin paths with -vDJ Delorie2020-03-111-6/+24
| | | | | | With this patch, -v turns on a "from" trace for each directory searched, that tells you WHY that directory is being searched - is it a builtin, from the command line, or from some config file?
* test-container: print errno when execvp failsMichael Hudson-Doyle2020-03-111-1/+1
| | | | | | | I'm debugging a situation where lots of tests using test-container fail and it's possible knowing errno would help understand why. Reviewed-by: DJ Delorie <dj@redhat.com>
* [AArch64] Improve integer memcpyWilco Dijkstra2020-03-111-96/+101
| | | | | | Further optimize integer memcpy. Small cases now include copies up to 32 bytes. 64-128 byte copies are split into two cases to improve performance of 64-96 byte copies. Comments have been rewritten.
* Add NEWS entry for CVE-2020-10029 (bug 25487)Aurelien Jarno2020-03-111-1/+3
|
* gcc PR 89877: miscompilation due to missing cc clobber in longlong.h macrosVineet Gupta2020-03-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | simple test such as below was failing. | void main(int argc, char *argv[]) | { | size_t total_time = 115424; // expected 115.424 | double secs = (double)total_time/(double)1000; | printf("%s %d %lf\n", "secs", total_time, secs); // prints 113.504 | printf("%d\n", (size_t)secs); | } The printf eventually called into glibc stdlib/divrem.c:__mpn_divrem() which uses the __arc__ specific inline asm macros from longlong.h which were causing miscompilation. include/ 2019-03-28 Vineet Gupta <vgupta@synopsys.com> PR 89877 * longlong.h [__arc__] (add_ssaaaa): Add cc clobber (sub_ddmmss): Likewise. Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
* mips: Fix wrong INTERNAL_SYSCALL_ERROR_P check from bc2eb9321eAdhemerval Zanella2020-03-101-1/+1
| | | | Checked on mips64-linux-gnu.
* elf: Fix wrong indentation from commit eb447b7b4bAdhemerval Zanella2020-03-101-5/+6
|
* y2038: linux: Provide __futimesat64 implementationLukasz Majewski2020-03-092-13/+32
| | | | | | | | | This conversion patch for supporting 64 bit time for futimesat only differs from the work performed for futimes (when providing __futimes64) with passing also the file name (and path) to utimensat. All the design and conversion decisions are exactly the same as for futimens conversion.
* y2038: linux: Provide __lutimes64 implementationLukasz Majewski2020-03-092-13/+27
| | | | | | | | | | | This conversion patch for supporting 64 bit time for lutimes mostly differs from the work performed for futimes (when providing __futimes64) with adding the AT_SYMLINK_NOFOLLOW flag to utimensat. It also supports passing file name instead of file descriptor number, but this is not relevant for utimensat used to implement it. All the design and conversion decisions are exactly the same as for futimens conversion.
* y2038: linux: Provide __futimes64 implementationLukasz Majewski2020-03-092-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides new __futimes64 explicit 64 bit function for setting file's 64 bit attributes for access and modification time (by specifying file descriptor number). Internally, the __utimensat64_helper function is used. This patch is necessary for having architectures with __WORDSIZE == 32 Y2038 safe. Moreover, a 32 bit version - __futimes has been refactored to internally use __futimes64. The __futimes is now supposed to be used on systems still supporting 32 bit time (__TIMESIZE != 64) - hence the necessary conversion of struct timeval to 64 bit struct __timeval64. The check if struct timevals' usec fields are in the range between 0 and 1000000 has been removed as Linux kernel performs it internally in the implementation of utimensat (the conversion between struct __timeval64 and __timespec64 is not relevant for this particular check). Last but not least, checks for tvp{64} not being NULL have been preserved from the original code as some legacy user space programs may rely on it. Build tests: ./src/scripts/build-many-glibcs.py glibcs Run-time tests: - Run specific tests on ARM/x86 32bit systems (qemu): https://github.com/lmajewski/meta-y2038 and run tests: https://github.com/lmajewski/y2038-tests/commits/master Above tests were performed with Y2038 redirection applied as well as without to test the proper usage of both __futimes64 and __futimes.
* y2038: fix: Add missing libc_hidden_def for __futimens64Lukasz Majewski2020-03-071-0/+2
| | | | | The libc_hidden_def () declaration for __futimens64 function was missing, so it is added in this patch.
* sparc: Move sigreturn stub to assemblyAdhemerval Zanella2020-03-065-38/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that some gcc versions might generates a stack frame for the sigreturn stub requires on sparc signal handling. For instance: $ cat test.c #define _GNU_SOURCE #include <sys/syscall.h> __attribute__ ((__optimize__ ("-fno-stack-protector"))) void __sigreturn_stub (void) { __asm__ ("mov %0, %%g1\n\t" "ta 0x10\n\t" : /* no outputs */ : "i" (SYS_rt_sigreturn)); } $ gcc -v [...] gcc version 9.2.1 20200224 (Debian 9.2.1-30) $ gcc -O2 -m64 test.c -S -o - [...] __sigreturn_stub: save %sp, -176, %sp #APP ! 9 "t.c" 1 mov 101, %g1 ta 0x10 ! 0 "" 2 #NO_APP .size __sigreturn_stub, .-__sigreturn_stub As indicated by kernel developers [1], the sigreturn stub can not change the register window or the stack pointer since the kernel has setup the restore frame at a precise location relative to the stack pointer when the stub is invoked. I tried to play with some compiler flags and even with _Noreturn and __builtin_unreachable after the asm does not help (and Sparc does not support naked functions). To avoid similar issues, as the stack-protector support also have stumbled, this patch moves the implementation of the sigreturn stubs to assembly. Checked on sparcv9-linux-gnu and sparc64-linux-gnu with gcc 9.2.1 and gcc 7.5.0. [1] https://lkml.org/lkml/2016/5/27/465
* ldbl-128ibm: Let long double files have specific compiler flagsTulio Magno Quites Machado Filho2020-03-061-3/+19
| | | | | | Soon, powerpc64le will need to provide extra compiler flags to the long double files in order to continue to build using the IBM 128-bit extended floating point type as long double.
* ldbl-128ibm-compat: Add tests for IBM long double functionsRajalakshmi Srinivasaraghavan2020-03-064-1/+35
| | | | | | | | | | | | This patch creates test-ibm128* tests from the long double function tests. In order to explicitly test IBM long double functions -mabi=ibmlongdouble is added to CFLAGS. Likewise, update the test headers to correct choose ULPs when redirects are enabled. Co-authored-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> Co-authored-by: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
* powerpc: Fix feraiseexcept and feclearexcept macrosMatheus Castanho2020-03-061-2/+2
| | | | | | | | | | | | | | | | | A recent change to fenvinline.h modified the check if __e is a a power of 2 inside feraiseexcept and feclearexcept macros. It introduced the use of the powerof2 macro but also removed the if statement checking whether __e != 0 before issuing an mtfsb* instruction. This is problematic because powerof2 (0) evaluates to 1 and without the removed if __e is allowed to be 0 when __builtin_clz is called. In that case the value 32 is passed to __MTFSB*, which is invalid. This commit uses __builtin_popcount instead of powerof2 to fix this issue and avoid the extra check for __e != 0. This was the approach used by the initial versions of that previous patch. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
* arm: Fix softp-fp Implies (BZ #25635)Adhemerval Zanella2020-03-062-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit "arm: Split BE/LE abilist" (1673ba87fefe019c834c09d33673d1d453ea698d) changed the soft-fp order for ARM selection when __SOFTFP__ is defined by the compiler. On 2.30 the sysdeps order is: 2.30 sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/nofpu sysdeps/ieee754/soft-fp sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic While on master is: sysdeps/unix/sysv/linux/arm/le sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptl sysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/le sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/arm/nofpu sysdeps/ieee754/soft-fp sysdeps/ieee754 sysdeps/generic It make the build select some routines (fadd, fdiv, fmul, fsub, and fma) on ieee754/flt-32 and ieee754/dbl-64 that requires fenv support to be correctly rounded which in turns lead to math failures since the __SOFTFP__ does not have fenv support. With this patch the order is now: sysdeps/unix/sysv/linux/arm/le sysdeps/unix/sysv/linux/arm sysdeps/arm/nptl sysdeps/unix/sysv/linux sysdeps/nptlsysdeps/pthread sysdeps/gnu sysdeps/unix/inet sysdeps/unix/sysv sysdeps/unix/arm sysdeps/unix sysdeps/posix sysdeps/arm/le/nofpu sysdeps/arm/nofpu sysdeps/ieee754/soft-fp sysdeps/arm/le sysdeps/arm sysdeps/wordsize-32 sysdeps/ieee754/flt-32 sysdeps/ieee754/dbl-64 sysdeps/ieee754 sysdeps/generic Checked on arm-linux-gnuaebi.
* Remove reference of --without-fp on configureAdhemerval Zanella2020-03-062-2/+4
|
* linux/sysipc: Include linux/posix_types.h for __kernel_mode_tAdhemerval Zanella2020-03-063-0/+3
| | | | | The posix_types.h (where __kernel_mode_t is defined) is included implicitly, which might not happen on older kernels.
* Improve IFUNC check [BZ #25506]Fangrui Song2020-03-052-2/+2
| | | | | | | | | GNU ld's RISCV port does not support IFUNC. ld -no-pie produces no relocation and the test passed incorrectly. Be more rigid by testing IRELATIVE explicitly. Tested-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux: Clear mode_t padding bits (BZ#25623)Adhemerval Zanella2020-03-053-6/+21
| | | | | | | | | | | | | | | | | | | | The kernel might not clear the padding value for the ipc_perm mode fields in compat mode (32 bit running on a 64 bit kernel). It was fixed on v4.14 when the ipc compat code was refactored to move (commits 553f770ef71b, 469391684626, c0ebccb6fa1e). Although it is most likely a kernel issue, it was shown only due BZ#18231 fix which made all the SysVIPC mode_t 32-bit regardless of the kABI. This patch fixes it by explicitly zeroing the upper bits for such cases. The __ASSUME_SYSVIPC_BROKEN_MODE_T case already handles it with the shift. (The aarch64 ipc_priv.h is superflous since __ASSUME_SYSVIPC_DEFAULT_IPC_64 is now defined as default). Checked on i686-linux-gnu on 3.10 and on 4.15 kernel.
* linux: Remove aarch64 ipc_priv.hAdhemerval Zanella2020-03-051-21/+0
| | | | | The aarch64 ipc_priv.h is superflous since __ASSUME_SYSVIPC_DEFAULT_IPC_64 is now defined as default.
* Linux: Use __fstatat64 in fchmodat implementationFlorian Weimer2020-03-051-1/+1
| | | | | | | fstatat64 depends on inlining to produce the desired __fxstatat64 call, which does not happen with -Os, leading to a link failure with an undefined reference to fstatat64. __fxstatat64 has a macro definition in include/sys/stat.h and thus avoids the problem.
* Linux: Use AT_FDCWD in utime, utimes when calling utimensatFlorian Weimer2020-03-052-2/+4
| | | | | | 0 is a valid descriptor without any special meaning. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* S390: Remove backchain-based fallback and use generic backtrace.c.Stefan Liebler2020-03-052-295/+0
| | | | | | | | | | | | | | | | | | | | | | After recent discussions: - "[PATCH] s390: Remove backchain-based fallback from backtrace" https://www.sourceware.org/ml/libc-alpha/2020-02/msg00287.html - "Re: [PATCH 07/11] s390: Implement backtrace on top of <unwind-link.h>" https://www.sourceware.org/ml/libc-alpha/2020-02/msg00637.html We've checked and decided to remove the backchain: We don't know of any environments without libgcc. Thus the backchain unwinder is not used. If somebody builds with -mbackchain and without fasynchronous-unwind-tables and has libgcc installed, then the libgcc unwinder is called but not the backchain-based fallback. This step allows to get rid of the s390x specific backtrace.c files at all. Furthermore the now used debug/backtrace.c version has some more advantages: - Free all resources if necessary. (libc_freeres_fn) - Remove NULL address above _start. - Check whether we make any progress while getting addresses.
* manual: Fix wrong declaration of wcschr [BZ #24654]Girish Joshi2020-03-051-1/+1
|
* manual: Fix typo in parse_printf_format example [BZ #24638]Girish Joshi2020-03-041-1/+1
|