about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* arm: Remove RELA supportAdhemerval Zanella2022-08-042-106/+1
| | | | | Now that prelink is not support, there is no need to keep supporting rela for non bootstrap.
* Remove ldd libc4 supportAdhemerval Zanella2022-08-0413-136/+2
| | | | The older libc versions are obsolete for over twenty years now.
* Assume only FLAG_ELF_LIBC6 suportLucas A. M. Magalhaes2022-08-0416-394/+14
| | | | | | | | | | | The older libc versions are obsolete for over twenty years now. This patch removes the special flags for libc5 and libc4 and assumes that all libraries cached are libc6 compatible and use FLAG_ELF_LIBC6. Checked with a build for all affected architectures. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Remove left over LD_LIBRARY_VERSION usagesAdhemerval Zanella2022-08-045-11/+0
| | | | | The environment variable was removed by d2db60d8d830ef68c8d20a77ac3572d610aa40b1.
* Linux: Remove exit system call from _exitFlorian Weimer2022-08-041-1/+0
| | | | | | exit only terminates the current thread, not the whole process, so it is the wrong fallback system call in this context. All supported Linux versions implement the exit_group system call anyway.
* LoongArch: Add vdso support for gettimeofday.caiyinyu2022-08-042-0/+23
|
* Update kernel version to 5.19 in header constant testsJoseph Myers2022-08-033-4/+4
| | | | | | | | | | This patch updates the kernel version in the tests tst-mman-consts.py, tst-mount-consts.py and tst-pidfd-consts.py to 5.18. (There are no new constants covered by these tests in 5.19, or in 5.17 or 5.18 in the case of tst-mount-consts.py that previously used version 5.16, that need any other header changes.) Tested with build-many-glibcs.py.
* assert: Do not use stderr in libc-internal assertFlorian Weimer2022-08-037-22/+50
| | | | | | | | | | | | | | | | | | | | Redirect internal assertion failures to __libc_assert_fail, based on based on __libc_message, which writes directly to STDERR_FILENO and calls abort. Also disable message translation and reword the error message slightly (adjusting stdlib/tst-bz20544 accordingly). As a result of these changes, malloc no longer needs its own redefinition of __assert_fail. __libc_assert_fail needs to be stubbed out during rtld dependency analysis because the rtld rebuilds turn __libc_assert_fail into __assert_fail, which is unconditionally provided by elf/dl-minimal.c. This change is not possible for the public assert macro and its __assert_fail function because POSIX requires that the diagnostic is written to stderr. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nptl: Remove uses of assert_perrorFlorian Weimer2022-08-031-8/+3
| | | | | | | | __pthread_sigmask cannot actually fail with valid pointer arguments (it would need a really broken seccomp filter), and we do not check for errors elsewhere. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* stdio: Clean up __libc_message after unconditional abortFlorian Weimer2022-08-034-40/+25
| | | | | | | | | | | | Since commit ec2c1fcefb200c6cb7e09553f3c6af8815013d83 ("malloc: Abort on heap corruption, without a backtrace [BZ #21754]"), __libc_message always terminates the process. Since commit a289ea09ea843ced6e5277c2f2e63c357bc7f9a3 ("Do not print backtraces on fatal glibc errors"), the backtrace facility has been removed. Therefore, remove enum __libc_message_action and the action argument of __libc_message, and mark __libc_message as _No_return. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Update syscall lists for Linux 5.19Joseph Myers2022-08-023-2/+4
| | | | | | | | | Linux 5.19 has no new syscalls, but enables memfd_secret in the uapi headers for RISC-V. Update the version number in syscall-names.list to reflect that it is still current for 5.19 and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
* Use Linux 5.19 in build-many-glibcs.pyJoseph Myers2022-08-021-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 5.19. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* socket: Check lengths before advancing pointer in CMSG_NXTHDRArjun Shankar2022-08-027-29/+276
| | | | | | | | | | | | | | | | | The inline and library functions that the CMSG_NXTHDR macro may expand to increment the pointer to the header before checking the stride of the increment against available space. Since C only allows incrementing pointers to one past the end of an array, the increment must be done after a length check. This commit fixes that and includes a regression test for CMSG_FIRSTHDR and CMSG_NXTHDR. The Linux, Hurd, and generic headers are all changed. Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x. [BZ #28846] Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Don't use unsupported format string in ld.so (bug 29427)Andreas Schwab2022-08-021-1/+1
| | | | | The dynamic loader does not support printf format strings that contain a literal field width or precision, they have to be specified indirectly.
* htl: Let pthread_self and cancellability called earlySamuel Thibault2022-08-022-1/+15
| | | | | | | When applications redirect some functions they might get called before libpthread is fully initialized. They may still expected pthread_self and cancellable functions to work, so cope with such calls in that situation.
* stdlib: Simplify arc4random_uniformAdhemerval Zanella2022-08-011-99/+30
| | | | | | | | | | | | | | | | | It uses the bitmask with rejection [1], which calculates a mask being the lowest power of two bounding the request upper bound, successively queries new random values, and rejects values outside the requested range. Performance-wise, there is no much gain in trying to conserve bits since arc4random is wrapper on getrandom syscall. It should be cheaper to just query a uint32_t value. The algorithm also avoids modulo and divide operations, which might be costly depending of the architecture. [1] https://www.pcg-random.org/posts/bounded-rands.html Reviewed-by: Yann Droneaud <ydroneaud@opteya.com>
* malloc: Use __getrandom_nocancel during tcache initiailizationFlorian Weimer2022-08-011-1/+2
| | | | | | | | | | Cancellation currently cannot happen at this point because dlopen as used by the unwind link always performs additional allocations for libgcc_s.so.1, even if it has been loaded already as a dependency of the main executable. But it seems prudent not to rely on this quirk. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Remove spurious references to _dl_open_hookFlorian Weimer2022-08-012-9/+0
| | | | | | | _dl_open_hook was removed in commit 466c1ea15f461edb8e3ffaf5d86d708 ("dlfcn: Rework static dlopen hooks"). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* wcsmbs: Add missing test-c8rtomb/test-mbrtoc8 dependencyH.J. Lu2022-08-011-0/+2
| | | | | | | | | | Make test-c8rtomb.out and test-mbrtoc8.out depend on $(gen-locales) for xsetlocale (LC_ALL, "de_DE.UTF-8"); xsetlocale (LC_ALL, "zh_HK.BIG5-HKSCS"); Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h.Tom Honermann2022-08-011-0/+8
| | | | | | | | | | | | | | | gcc 13 issues the following diagnostic for the uchar.h header when the -Wc++20-compat option is enabled in C++ modes that do not enable char8_t as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE and the gcc -f[no-]char8_t option). warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat] This change modifies the uchar.h header to suppress the diagnostic through the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the -Wc++20-compat option was added in gcc version 10). Unfortunately, a bug in gcc currently prevents those directives from having the intended effect as reported at https://gcc.gnu.org/PR106423. A patch for that issue has been submitted and is available in the email thread archive linked below. https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
* Open master branch for glibc 2.37 development glibc-2.36.9000Carlos O'Donell2022-07-302-2/+25
|
* Create ChangeLog.old/ChangeLog.25. glibc-2.36Carlos O'Donell2022-07-291-0/+10229
|
* Prepare for glibc 2.36 release.Carlos O'Donell2022-07-292-3/+3
| | | | Update version.h, and include/features.h.
* Update install.texi, and regenerate INSTALL.Carlos O'Donell2022-07-292-13/+13
|
* Update NEWS bug list.Carlos O'Donell2022-07-291-11/+99
|
* Update libc.pot for 2.36 release.Carlos O'Donell2022-07-291-197/+201
|
* tst-pidfd.c: UNSUPPORTED if we get EPERM on valid pidfd_getfd callMark Wielaard2022-07-291-0/+7
| | | | | | | | pidfd_getfd can fail for a valid pidfd with errno EPERM for various reasons in a restricted environment. Use FAIL_UNSUPPORTED in that case. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* stdlib: Tuned down tst-arc4random-thread internal parametersAdhemerval Zanella2022-07-291-6/+18
| | | | | | | | | | | | | | | | With new arc4random implementation, the internal parameters might require a lot of runtime and/or trigger some contention on older kernels (which might trigger spurious timeout failures). Also, since we are now testing getrandom entropy instead of an userspace RNG, there is no much need to extensive testing. With this change the tst-arc4random-thread goes from about 1m to 5s on a Ryzen 9 with 5.15.0-41-generic. Checked on x86_64-linux-gnu. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* LoongArch: Add greg_t and gregset_t.caiyinyu2022-07-291-0/+3
|
* LoongArch: Fix VDSO_HASH and VDSO_NAME.caiyinyu2022-07-291-2/+2
|
* riscv: Update rv64 libm test ulpsDarius Rad2022-07-271-1/+1
| | | | | | Generated on a Microsemi Polarfire Icicle Kit running Linux version 5.15.32. Same ULPs were also produced on QEMU 5.2.0 running Linux 5.18.0.
* riscv: Update nofpu libm test ulpsDarius Rad2022-07-271-31/+39
|
* arc4random: simplify design for better safetyJason A. Donenfeld2022-07-2735-2676/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than buffering 16 MiB of entropy in userspace (by way of chacha20), simply call getrandom() every time. This approach is doubtlessly slower, for now, but trying to prematurely optimize arc4random appears to be leading toward all sorts of nasty properties and gotchas. Instead, this patch takes a much more conservative approach. The interface is added as a basic loop wrapper around getrandom(), and then later, the kernel and libc together can work together on optimizing that. This prevents numerous issues in which userspace is unaware of when it really must throw away its buffer, since we avoid buffering all together. Future improvements may include userspace learning more from the kernel about when to do that, which might make these sorts of chacha20-based optimizations more possible. The current heuristic of 16 MiB is meaningless garbage that doesn't correspond to anything the kernel might know about. So for now, let's just do something conservative that we know is correct and won't lead to cryptographic issues for users of this function. This patch might be considered along the lines of, "optimization is the root of all evil," in that the much more complex implementation it replaces moves too fast without considering security implications, whereas the incremental approach done here is a much safer way of going about things. Once this lands, we can take our time in optimizing this properly using new interplay between the kernel and userspace. getrandom(0) is used, since that's the one that ensures the bytes returned are cryptographically secure. But on systems without it, we fallback to using /dev/urandom. This is unfortunate because it means opening a file descriptor, but there's not much of a choice. Secondly, as part of the fallback, in order to get more or less the same properties of getrandom(0), we poll on /dev/random, and if the poll succeeds at least once, then we assume the RNG is initialized. This is a rough approximation, as the ancient "non-blocking pool" initialized after the "blocking pool", not before, and it may not port back to all ancient kernels, though it does to all kernels supported by glibc (≥3.2), so generally it's the best approximation we can do. The motivation for including arc4random, in the first place, is to have source-level compatibility with existing code. That means this patch doesn't attempt to litigate the interface itself. It does, however, choose a conservative approach for implementing it. Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Florian Weimer <fweimer@redhat.com> Cc: Cristian Rodríguez <crrodriguez@opensuse.org> Cc: Paul Eggert <eggert@cs.ucla.edu> Cc: Mark Harris <mark.hsj@gmail.com> Cc: Eric Biggers <ebiggers@kernel.org> Cc: linux-crypto@vger.kernel.org Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* LoongArch: Update NEWS and README for the LoongArch port.caiyinyu2022-07-263-1/+10
|
* LoongArch: Update build-many-glibcs.py for the LoongArch Port.caiyinyu2022-07-261-0/+5
|
* LoongArch: Hard Float Supportcaiyinyu2022-07-2622-0/+2372
|
* LoongArch: Build Infrastructurecaiyinyu2022-07-2615-0/+434
|
* LoongArch: Add ABI Listscaiyinyu2022-07-2611-0/+3385
|
* LoongArch: Linux ABIcaiyinyu2022-07-2617-0/+826
|
* LoongArch: Linux Syscall Interfacecaiyinyu2022-07-268-0/+947
|
* LoongArch: Atomic and Locking Routinescaiyinyu2022-07-261-0/+147
|
* LoongArch: Generic <math.h> and soft-fp Routinescaiyinyu2022-07-265-0/+321
|
* LoongArch: Thread-Local Storage Supportcaiyinyu2022-07-264-0/+249
|
* LoongArch: ABI Implementationcaiyinyu2022-07-2618-0/+959
|
* LoongArch: Add relocations and ELF flags to elf.h and scripts/glibcelf.pycaiyinyu2022-07-262-2/+69
|
* LoongArch: Add LoongArch entries to config.h.incaiyinyu2022-07-261-0/+6
|
* struct stat is not posix conformant on microblaze with __USE_FILE_OFFSET64Arnout Vandecappelle (Essensium/Mind)2022-07-251-1/+1
| | | | | | | | | | | Commit a06b40cdf5ba0d2ab4f9b4c77d21e45ff284fac7 updated stat.h to use __USE_XOPEN2K8 instead of __USE_MISC to add the st_atim, st_mtim and st_ctim members to struct stat. However, for microblaze, there are two definitions of struct stat, depending on the __USE_FILE_OFFSET64 macro. The second one was not updated. Change __USE_MISC to __USE_XOPEN2K8 in the __USE_FILE_OFFSET64 version of struct stat for microblaze.
* Linux: dirent/tst-readdir64-compat needs to use TEST_COMPAT (bug 27654)Florian Weimer2022-07-252-6/+8
| | | | | | | | | | | The hppa port starts libc at GLIBC_2.2, but has earlier symbol versions in other shared objects. This means that the compat symbol for readdir64 is not actually present in libc even though have-GLIBC_2.1.3 is defined as yes at the make level. Fixes commit 15e50e6c966fa0f26612602a95f0129543d9f9d5 ("Linux: dirent/tst-readdir64-compat can be a regular test") by mostly reverting it.
* manual: Add documentation for arc4random functionsAdhemerval Zanella Netto2022-07-221-0/+46
|
* s390x: Add optimized chacha20Adhemerval Zanella Netto2022-07-224-1/+626
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It adds vectorized ChaCha20 implementation based on libgcrypt cipher/chacha20-s390x.S. The final state register clearing is omitted. On a z15 it shows the following improvements (using formatted bench-arc4random data): GENERIC MB/s ----------------------------------------------- arc4random [single-thread] 198.92 arc4random_buf(16) [single-thread] 244.49 arc4random_buf(32) [single-thread] 282.73 arc4random_buf(48) [single-thread] 286.64 arc4random_buf(64) [single-thread] 320.06 arc4random_buf(80) [single-thread] 297.43 arc4random_buf(96) [single-thread] 310.96 arc4random_buf(112) [single-thread] 308.10 arc4random_buf(128) [single-thread] 309.90 ----------------------------------------------- VX. MB/s ----------------------------------------------- arc4random [single-thread] 430.26 arc4random_buf(16) [single-thread] 735.14 arc4random_buf(32) [single-thread] 1029.99 arc4random_buf(48) [single-thread] 1206.76 arc4random_buf(64) [single-thread] 1311.92 arc4random_buf(80) [single-thread] 1378.74 arc4random_buf(96) [single-thread] 1445.06 arc4random_buf(112) [single-thread] 1484.32 arc4random_buf(128) [single-thread] 1517.30 ----------------------------------------------- Checked on s390x-linux-gnu.