about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* resolv: Add tst-resolv-aliasesFlorian Weimer2022-09-132-0/+256
| | | | | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 87aa98aa80627553a66bdcad2701fd6307723645)
* resolv: Add tst-resolv-byaddr for testing reverse lookupFlorian Weimer2022-09-133-0/+360
| | | | | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 0b99828d54e5d1fc8f5ad3edf5ba262ad2e9c5b0)
* nscd: Fix netlink cache invalidation if epoll is used [BZ #29415]Fabian Vogt2022-09-062-1/+3
| | | | | | | | | | | | | | | | | | | | | | Processes cache network interface information such as whether IPv4 or IPv6 are enabled. This is only checked again if the "netlink timestamp" provided by nscd changed, which is triggered by netlink socket activity. However, in the epoll handler for the netlink socket, it was missed to assign the new timestamp to the nscd database. The handler for plain poll did that properly, copy that over. This bug caused that e.g. processes which started before network configuration got unusuable addresses from getaddrinfo, like IPv6 only even though only IPv4 is available: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041 It's a bit hard to reproduce, so I verified this by checking the timestamp on calls to __check_pf manually. Without this patch it's stuck at 1, now it's increasing on network changes as expected. Signed-off-by: Fabian Vogt <fvogt@suse.de> (cherry picked from commit 02ca25fef2785974011e9c5beecc99b900b69fd7)
* Add NEWS entry for CVE-2022-39046Siddhesh Poyarekar2022-09-061-0/+7
| | | | (cherry picked from commit 76fe56020e7ef354685b2284580ac1630c078a2b)
* syslog: Remove extra whitespace between timestamp and message (BZ#29544)Adhemerval Zanella2022-09-052-4/+7
| | | | | | | The rfc3164 clear states that a single space character must follow the timestamp field. Checked on x86_64-linux-gnu.
* elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ ↵Adhemerval Zanella2022-08-312-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | #29539) The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like dependencies are printed, instead of just the name and address it follows other libraries mode and prints 'name => path'. Unfortunately, this broke some ldd consumer that uses the output to filter out the program's dependencies. For instance CMake bundleutilities module [1], where GetPrequirite uses the regex to filter out 'name => path' [2]. This patch restore the previous way to print just the name and the mapping address. Checked on x86_64-linux-gnu. [1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities [2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733 Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 1e903124cec4492463d075c6c061a2a772db77bf)
* Apply asm redirections in wchar.h before first useRaphael Moreira Zinsly2022-08-315-76/+137
| | | | | | | | | | | | | Similar to d0fa09a770, but for wchar.h. Fixes [BZ #27087] by applying all long double related asm redirections before using functions in bits/wchar2.h. Moves the function declarations from wcsmbs/bits/wchar2.h to a new file wcsmbs/bits/wchar2-decl.h that will be included first in wcsmbs/wchar.h. Tested with build-many-glibcs.py. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> (cherry picked from commit c7509d49c4e8fa494120c5ead21338559dad16f5)
* elf: Call __libc_early_init for reused namespaces (bug 29528)Florian Weimer2022-08-306-5/+155
| | | | | | | | | | | | libc_map is never reset to NULL, neither during dlclose nor on a dlopen call which reuses the namespace structure. As a result, if a namespace is reused, its libc is not initialized properly. The most visible result is a crash in the <ctype.h> functions. To prevent similar bugs on namespace reuse from surfacing, unconditionally initialize the chosen namespace to zero using memset. (cherry picked from commit d0e357ff45a75553dee3b17ed7d303bfa544f6fe)
* syslog: Fix large messages (BZ#29536)Adhemerval Zanella2022-08-302-28/+142
| | | | | | | | | | | | | | The a583b6add407c17cd change did not handle large messages that would require a heap allocation correctly, where the message itself is not take in consideration. This patch fixes it and extend the tst-syslog to check for large messages as well. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 52a5be0df411ef3ff45c10c7c308cb92993d15b1)
* Linux: Fix enum fsconfig_command detection in <sys/mount.h>Florian Weimer2022-08-241-3/+3
| | | | | | | | | | | The #ifdef FSOPEN_CLOEXEC check did not work because the macro was always defined in this header prior to the check, so that the <linux/mount.h> contents did not matter. Fixes commit 774058d72942249f71d74e7f2b639f77184160a6 ("linux: Fix sys/mount.h usage with kernel headers"). (cherry picked from commit 2955ef4b7c9b56fcd7abfeddef7ee83c60abff98)
* linux: Fix sys/mount.h usage with kernel headersAdhemerval Zanella2022-08-243-8/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that kernel exports linux/mount.h and includes it on linux/fs.h, its definitions might clash with glibc exports sys/mount.h. To avoid the need to rearrange the Linux header to be always after glibc one, the glibc sys/mount.h is changed to: 1. Undefine the macros also used as enum constants. This covers prior inclusion of <linux/mount.h> (for instance MS_RDONLY). 2. Include <linux/mount.h> based on the usual __has_include check (needs to use __has_include ("linux/mount.h") to paper over GCC bugs. 3. Define enum fsconfig_command only if FSOPEN_CLOEXEC is not defined. (FSOPEN_CLOEXEC should be a very close proxy.) 4. Define struct mount_attr if MOUNT_ATTR_SIZE_VER0 is not defined. (Added in the same commit on the Linux side.) This patch also adds some tests to check if including linux/fs.h and linux/mount.h after and before sys/mount.h does work. Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 774058d72942249f71d74e7f2b639f77184160a6)
* linux: Use compile_c_snippet to check linux/mount.h availabilityAdhemerval Zanella2022-08-241-0/+5
| | | | | | | Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit e1226cdc6b209539a92d32d5b620ba53fd35abf3)
* linux: Mimic kernel defition for BLOCK_SIZEAdhemerval Zanella2022-08-241-1/+1
| | | | | | | | To avoid possible warnings if the kernel header is included before sys/mount.h. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit c68b6044bc7945716431f1adc091b17c39b80a06)
* linux: Use compile_c_snippet to check linux/pidfd.h availabilityAdhemerval Zanella2022-08-241-4/+6
| | | | | | | | | Instead of tying to a specific kernel version. Checked on x86_64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 1542019b69b7ec7b2cd34357af035e406d153631)
* glibcextract.py: Add compile_c_snippetAdhemerval Zanella2022-08-241-0/+19
| | | | | | | | It might be used on tests to check if a snippet build with the provided compiler and flags. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 841afa116e32b3c7195475769c26bf46fd870d32)
* NEWS: Add entry for bug 28846Arjun Shankar2022-08-221-0/+1
|
* socket: Check lengths before advancing pointer in CMSG_NXTHDRArjun Shankar2022-08-227-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> (cherry picked from commit 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
* alpha: Fix generic brk system call emulation in __brk_call (bug 29490)Florian Weimer2022-08-222-4/+4
| | | | | | | | | | The kernel special-cases the zero argument for alpha brk, and we can use that to restore the generic Linux error handling behavior. Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux: Introduce __brk_call for invoking the brk system call"). (cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
* Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)Florian Weimer2022-08-162-2/+6
| | | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com> (cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
* elf: Replace `strcpy` call with `memcpy` [BZ #29454]Noah Goldstein2022-08-111-2/+3
| | | | | | | | | GCC normally does this optimization for us in strlen_pass::handle_builtin_strcpy but only for optimized build. To avoid needing to include strcpy.S in the rtld build to support the debug build, just do the optimization by hand. (cherry picked from commit 483cfe1a6a33d6335b1901581b41040d2d412511)
* Update syscall lists for Linux 5.19Joseph Myers2022-08-053-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. (cherry picked from commit fccadcdf5bed7ee67a6cef4714e0b477d6c8472c)
* dlfcn: Pass caller pointer to static dlopen implementation (bug 29446)Florian Weimer2022-08-042-1/+8
| | | | | | | Fixes commit 0c1c3a771eceec46e66ce1183cf988e2303bd373 ("dlfcn: Move dlopen into libc"). (cherry picked from commit ed0185e4129130cbe081c221efb758fb400623ce)
* 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> (cherry picked from commit e03f5ccd6cc8f829416156eac75acee501626c1f)
* 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 (cherry picked from commit 825f84f133bd840347dc49229b6d831f07d04775)
* 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.