about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* math: Fix isnanf128 static build (BZ 31774)Adhemerval Zanella2024-05-211-0/+4
| | | | | | | | Some static implementation of float128 routines might call __isnanf128, which is not provided by the static object. Checked on x86_64-linux-gnu. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* math: Add support for auto static math testsAdhemerval Zanella2024-05-2112-5/+133
| | | | | | | | | | | | | | | It basically copy the already in place rules for dynamic tests for auto-generated math functions for all support types. To avoid the need to duplicate .inc files, a .SECONDEXPANSION rules is adeed for the gen-libm-test.py generation. New tests are added on the new rules 'libm-test-funcs-auto-static', 'libm-test-funcs-noauto-static', and 'libm-test-funcs-narrow-static'; similar to the non-static counterparts. To avoid add extra build and disk requirement, the new math static tests are only enable with a new define 'build-math-static-tests'. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
* Change _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols [BZ #31766]H.J. Lu2024-05-211-0/+4
| | | | | | | | | Since Glibc never provides symbol binary compatibility for relocatable files, fix BZ #31766 by changing _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* Obsolete _dl_mcount_wrapper in glibc 2.40 [BZ #31765]H.J. Lu2024-05-211-1/+5
| | | | | | | | | There is no _dl_mcount_wrapper prototype in any installed header files. Fix BZ #31765 by changing _dl_mcount_wrapper to a compat symbol and obsolete it in glibc 2.40. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* math: Fix i386 and m68k exp10 on static build (BZ 31775)Adhemerval Zanella2024-05-212-4/+14
| | | | | | | | | | | The commit 08ddd26814 removed the static exp10 on i386 and m68k with an empty w_exp10.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_exp{f}_compat.c implementation. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
* math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)Adhemerval Zanella2024-05-215-13/+17
| | | | | | | | | | | | | | | The commit 16439f419b removed the static fmod/fmodf on i386 and m68k with and empty w_fmod.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_fmod{f}_compat.c implementation. To statically build fmod fails on some ABI (alpha, s390, sparc) because it does not export the ldexpf128, this is also fixed by this patch. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Tested-by: Aurelien Jarno <aurelien@aurel32.net>
* Remove the clone3 symbol from libc.a [BZ #31770]H.J. Lu2024-05-2111-11/+0
| | | | | | | | clone3 isn't exported from glibc and is hidden in libc.so. Fix BZ #31770 by removing clone3 alias. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* aarch64/fpu: Add vector variants of powJoe Ramsay2024-05-2121-12/+2236
| | | | | | | Plus a small amount of moving includes around in order to be able to remove duplicate definition of asuint64. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Compile libmvec with -fno-math-errnoJoe Ramsay2024-05-211-3/+4
| | | | | | | | | | | Rounding intrinsics may not be inlined without -fno-math-errno. libmvec is free to do what it likes with errno, so disable it for better performance. Tested with no regression on aarch64 and x86_64. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* manual: clarify defintions of floating point exponent bounds (bug 31518)Andreas Schwab2024-05-211-5/+5
| | | | | For decimal exponent bounds the range is inclusive, for binary exponent bounds the range is exclusive.
* LoongArch: Update ulpscaiyinyu2024-05-211-0/+20
| | | | For the log2p1 implementation.
* LoongArch: Fix tst-gnu2-tls2 compiler errormengqinggang2024-05-213-2/+8
| | | | | Add -mno-lsx to tst-gnu2-tlsmod*.c if gcc support -mno-lsx. Add escape character '\' in vector support test function.
* resolv: Make _res_opcodes a compat symbol [BZ #31764]H.J. Lu2024-05-201-0/+1
| | | | | | | | _res_opcodes was exported by accident as a variable. Fix BZ #31764 by making _res_opcodes a compat symbol. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* i386: Don't define stpncpy alias when used in IFUNC [BZ #31768]H.J. Lu2024-05-201-0/+2
| | | | | | | Fix BZ #31768 by not defining stpncpy alias when used in IFUNC. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* powerpc: Update ulpsAdhemerval Zanella2024-05-201-0/+24
| | | | For the log2p1 implementation.
* arm: Update ulpsAdhemerval Zanella2024-05-201-0/+16
| | | | For the log2p1 implementation.
* aarch64: Update ulpsAdhemerval Zanella2024-05-201-0/+20
| | | | For the log2p1 implementation.
* math: Add more details to the test driver output.Joe Simmons-Talbott2024-05-203-49/+162
| | | | | | | | | | | | | Add start and end indicators that identify the test being run in the verbose output. Better identify the tests for max errors in the summary output. Count each exception checked for each test. Remove double counting of tests for the check_<type> functions other than check_float_internal. Rename print_max_error and print_complex_max_error to check_max_error and check_complex_max_error respectively since they have side effects. Co-Authored-By: Carlos O'Donell <carlos@redhat.com> Reviewed-By: Joseph Myers <josmyers@redhat.com>
* Implement C23 log2p1Joseph Myers2024-05-2052-2/+3206
| | | | | | | | | | | | | | | | | | | | | | | | C23 adds various <math.h> function families originally defined in TS 18661-4. Add the log2p1 functions (log2(1+x): like log1p, but for base-2 logarithms). This illustrates the intended structure of implementations of all these function families: define them initially with a type-generic template implementation. If someone wishes to add type-specific implementations, it is likely such implementations can be both faster and more accurate than the type-generic one and can then override it for types for which they are implemented (adding benchmarks would be desirable in such cases to demonstrate that a new implementation is indeed faster). The test inputs are copied from those for log1p. Note that these changes make gen-auto-libm-tests depend on MPFR 4.2 (or later). The bulk of the changes are fairly generic for any such new function. (sysdeps/powerpc/nofpu/Makefile only needs changing for those type-generic templates that use fabs.) Tested for x86_64 and x86, and with build-many-glibcs.py.
* Update syscall lists for Linux 6.9Joseph Myers2024-05-201-2/+2
| | | | | | | Linux 6.9 has no new syscalls. Update the version number in syscall-names.list to reflect that it is still current for 6.9. Tested with build-many-glibcs.py.
* Rename procutils_read_file to __libc_procutils_read_file [BZ #31755]H.J. Lu2024-05-203-5/+7
| | | | | | | | Fix BZ #31755 by renaming the internal function procutils_read_file to __libc_procutils_read_file. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* nearbyint: Don't define alias when used in IFUNC [BZ #31759]H.J. Lu2024-05-202-0/+4
| | | | | | | Fix BZ #31759 by not defining nearbyint aliases when used in IFUNC. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* Pass -nostdlib -nostartfiles together with -r [BZ #31753]H.J. Lu2024-05-191-1/+2
| | | | | | | | | Since -r in GCC 6/7/8 doesn't imply -nostdlib -nostartfiles, update the link-static-libc.out rule to also pass -nostdlib -nostartfiles. This fixes BZ #31753. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* socket: Use may_alias on sockaddr structs (bug 19622)Florian Weimer2024-05-1810-14/+25
| | | | | | | | | | | | | | This supports common coding patterns. The GCC C front end before version 7 rejects the may_alias attribute on a struct definition if it was not present in a previous forward declaration, so this attribute can only be conditionally applied. This implements the spirit of the change in Austin Group issue 1641. Suggested-by: Marek Polacek <polacek@redhat.com> Suggested-by: Jakub Jelinek <jakub@redhat.com> Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Use a doubly-linked list for _IO_list_all (bug 27777)Alexandre Ferrieux2024-05-173-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes BZ #27777 "fclose does a linear search, takes ages when many FILE* are opened". Simply put, the master list of opened (FILE*), namely _IO_list_all, is a singly-linked list. As a consequence, the removal of a single element is in O(N), which cripples the performance of fclose(). The patch switches to a doubly-linked list, yielding O(1) removal. The one padding field in struct _IO_FILE, __pad5, is renamed to _prevchain for a doubly-linked list. Since fields in struct _IO_FILE after the _lock field are internal to glibc and opaque to applications. We can change them as long as the size of struct _IO_FILE is unchanged, which is checked as the part of glibc ABI with sizes of _IO_2_1_stdin_, _IO_2_1_stdout_ and _IO_2_1_stderr_. NB: When _IO_vtable_offset (fp) == 0, copy relocation will cover the whole struct _IO_FILE. Otherwise, only fields up to the _lock field will be copied to applications at run-time. It is used to check if the _prevchain field can be safely accessed. After opening 2 million (FILE*), the fclose() of 100 of them takes quite a few seconds without the patch, and under 2 seconds with it on a loaded machine. No test is added since there are no functional changes. Co-Authored-By: H.J. Lu <hjl.tools@gmail.com> Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* powerpc64: Fix by using the configure value $libc_cv_cc_submachine [BZ ↵Manjunath Matti2024-05-162-4/+4
| | | | | | | | | | #31629] This patch ensures that $libc_cv_cc_submachine, which is set from "--with-cpu", overrides $CFLAGS for configure time tests. Suggested-by: Peter Bergner <bergner@linux.ibm.com> Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
* benchtests: Add fclose benchmarkH.J. Lu2024-05-163-0/+82
| | | | | | | Measure duration of 100 fclose calls after opening 1 million FILEs. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* aarch64/fpu: Add vector variants of cbrtJoe Ramsay2024-05-1614-0/+526
| | | | Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64/fpu: Add vector variants of hypotJoe Ramsay2024-05-1614-0/+329
| | | | Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Use Linux 6.9 in build-many-glibcs.pyJoseph Myers2024-05-161-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.9. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* localedata: Fix several issues with the set of characters considered 0-width ↵Jules Bertholet2024-05-156-1898/+979
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [BZ #31370] = `Default_Ignorable_Code_Point`s should have width 0 = Unicode specifies (https://www.unicode.org/faq/unsup_char.html#3) that characters with the `Default_Ignorable_Code_Point` property > should be rendered as completely invisible (and non advancing, i.e. “zero width”), if not explicitly supported in rendering. Hence, `wcwidth()` should give them all a width of 0, with two exceptions: - the soft hyphen (U+00AD SOFT HYPHEN) is assigned width 1 by longstanding precedent - U+115F HANGUL CHOSEONG FILLER needs a carveout due to the unique behavior of the conjoining Korean jamo characters. One composed Hangul "syllable block" like 퓛 is made up of two to three individual component characters, or "jamo". These are all assigned an `East_Asian_Width` of `Wide` by Unicode, which would normally mean they would all be assigned width 2 by glibc; a combination of (leading choseong jamo) + (medial jungseong jamo) + (trailing jongseong jamo) would then have width 2 + 2 + 2 = 6. However, glibc (and other wcwidth implementations) special-cases jungseong and jongseong, assigning them all width 0, to ensure that the complete block has width 2 + 0 + 0 = 2 as it should. U+115F is meant for use in syllable blocks that are intentionally missing a leading jamo; it must be assigned a width of 2 even though it has no visible display to ensure that the complete block has width 2. However, `wcwidth()` currently (before this patch) incorrectly assigns non-zero width to U+3164 HANGUL FILLER and U+FFA0 HALFWIDTH HANGUL FILLER; this commit fixes that. Unicode spec references: - Hangul: §3.12 https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf#G24646 and §18.6 https://www.unicode.org/versions/Unicode15.0.0/ch18.pdf#G31028 - `Default_Ignorable_Code_Point`: §5.21 https://www.unicode.org/versions/Unicode15.0.0/ch05.pdf#G40095. = Non-`Default_Ignorable_Code_Point` format controls should be visible = The Unicode Standard, §5.21 - Characters Ignored for Display (https://www.unicode.org/versions/Unicode15.0.0/ch05.pdf#G40095) says the following: > A small number of format characters (General_Category = Cf ) > are also not given the Default_Ignorable_Code_Point property. > This may surprise implementers, who often assume > that all format characters are generally ignored in fallback display. > The exact list of these exceptional format characters > can be found in the Unicode Character Database. > There are, however, three important sets of such format characters to note: > > - prepended concatenation marks > - interlinear annotation characters > - Egyptian hieroglyph format controls > > The prepended concatenation marks always have a visible display. > See “Prepended Concatenation Marks” in [*Section 23.2, Layout Controls*](https://www.unicode.org/versions/Unicode15.1.0/ch23.pdf#M9.35858.HeadingBreak.132.Layout.Controls) > for more discussion of the use and display of these signs. > > The other two notable sets of format characters that exceptionally are not ignored > in fallback display consist of the interlinear annotation characters, > U+FFF9 INTERLINEAR ANNOTATION ANCHOR through > U+FFFB INTERLINEAR ANNOTATION TERMINATOR, > and the Egyptian hieroglyph format controls, > U+13430 EGYPTIAN HIEROGLYPH VERTICAL JOINER through > U+1343F EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE. > These characters should have a visible glyph display for fallback rendering, > because if they are not displayed, > it is too easy to misread the resulting displayed text. > See “Annotation Characters” in [*Section 23.8, Specials*](https://www.unicode.org/versions/Unicode15.1.0/ch23.pdf#M9.21335.Heading.133.Specials), > as well as [*Section 11.4, Egyptian Hieroglyphs*](https://www.unicode.org/versions/Unicode15.1.0/ch11.pdf#M9.73291.Heading.1418.Egyptian.Hieroglyphs) > for more discussion of the use and display of these characters. glibc currently correctly assigns non-zero width to the prepended concatenation marks, but it incorrectly gives zero width to the interlinear annotation characters (which a generic terminal cannot interpret) and the Egyptian hieroglyph format controls (which are not widely supported in rendering implementations at present). This commit fixes both these issues as well. = Derive Hangul syllable type from Unicode data = Previosuly, the jungseong and jongseong jamo ranges were hard-coded into the script. With this commit, they are instead parsed from the HangulSyllableType.txt data file published by Unicode. This does not affect the end result. Signed-off-by: Jules Bertholet <julesbertholet@quoi.xyz>
* LoongArch: Add support for TLS Descriptorsmengqinggang2024-05-1516-8/+1076
| | | | | | | | | This is mostly based on AArch64 and RISC-V implementation. Add R_LARCH_TLS_DESC32 and R_LARCH_TLS_DESC64 relocations. For _dl_tlsdesc_dynamic function slow path, temporarily save and restore all vector registers.
* math: Add GLIBC_TEST_LIBM_VERBOSE environment variable support.Joe Talbott2024-05-141-2/+21
| | | | | | | | | | Allow the libm-test-driver based tests to have their verbosity set based on the GLIBC_TEST_LIBM_VERBOSE environment variable. This allows the entire testsuite to be run with a non-default verbosity. While here check the conversion for the verbose option as well. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* malloc: Improve aligned_alloc and calloc test coverage.Joe Simmons-Talbott2024-05-145-0/+151
| | | | | | | | | | | | | | | Add a DSO (malloc/tst-aligned_alloc-lib.so) that can be used during testing to interpose malloc with a call that randomly uses either aligned_alloc, __libc_malloc, or __libc_calloc in the place of malloc. Use LD_PRELOAD with the DSO to mirror malloc/tst-malloc.c testing as an example in malloc/tst-malloc-random.c. Add malloc/tst-aligned-alloc-random.c as another example that does a number of malloc calls with randomly sized, but limited to 0xffff, requests. The intention is to be able to utilize existing malloc testing to ensure that similar allocation APIs are also exposed to the same rigors. Reviewed-by: DJ Delorie <dj@redhat.com>
* aarch64: Fix AdvSIMD libmvec routines for big-endianJoe Ramsay2024-05-1417-85/+119
| | | | | | | | | | | | | | | | | | | | Previously many routines used * to load from vector types stored in the data table. This is emitted as ldr, which byte-swaps the entire vector register, and causes bugs for big-endian when not all lanes contain the same value. When a vector is to be used this way, it has been replaced with an array and the load with an explicit ld1 intrinsic, which byte-swaps only within lanes. As well, many routines previously used non-standard GCC syntax for vector operations such as indexing into vectors types with [] and assembling vectors using {}. This syntax should not be mixed with ACLE, as the former does not respect endianness whereas the latter does. Such examples have been replaced with, for instance, vcombine_* and vgetq_lane* intrinsics. Helpers which only use the GCC syntax, such as the v_call helpers, do not need changing as they do not use intrinsics. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Unify output from backtrace_symbols_fd with backtrace_symbols (bug 31730)Andreas Schwab2024-05-141-2/+8
|
* manual: add dup3DJ Delorie2024-05-131-0/+8
| | | | Reviewed-by: Florian Weimer <fweimer@redhat.com>
* libio/bug-wsetpos: Make the error message match the causing functionMaciej W. Rozycki2024-05-131-1/+1
| | | | | | | | | This test case calls `fopen': FILE *fp = fopen (temp_file, "r"); however if that fails it reports `fdopen' being the origin of the error. Adjust the message to say `fopen' then.
* malloc/Makefile: Split and sort testsH.J. Lu2024-05-101-64/+102
| | | | | | | Put each test on a separate line and sort tests. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Force DT_RPATH for --enable-hardcoded-path-in-testsH.J. Lu2024-05-091-3/+6
| | | | | | | | | | | | | | | | | | | On Fedora 40/x86-64, linker enables --enable-new-dtags by default which generates DT_RUNPATH instead of DT_RPATH. Unlike DT_RPATH, DT_RUNPATH only applies to DT_NEEDED entries in the executable and doesn't applies to DT_NEEDED entries in shared libraries which are loaded via DT_NEEDED entries in the executable. Some glibc tests have libstdc++.so.6 in DT_NEEDED, which has libm.so.6 in DT_NEEDED. When DT_RUNPATH is generated, /lib64/libm.so.6 is loaded for such tests. If the newly built glibc is older than glibc 2.36, these tests fail with assert/tst-assert-c++: /export/build/gnu/tools-build/glibc-gitlab-release/build-x86_64-linux/libc.so.6: version `GLIBC_2.36' not found (required by /lib64/libm.so.6) assert/tst-assert-c++: /export/build/gnu/tools-build/glibc-gitlab-release/build-x86_64-linux/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /lib64/libm.so.6) Pass -Wl,--disable-new-dtags to linker when building glibc tests with --enable-hardcoded-path-in-tests. This fixes BZ #31719. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
* powerpc: Fix __fesetround_inline_nocheck on POWER9+ (BZ 31682)Adhemerval Zanella2024-05-092-14/+8
| | | | | | | | | | | | | | | The e68b1151f7460d5fa88c3a567c13f66052da79a7 commit changed the __fesetround_inline_nocheck implementation to use mffscrni (through __fe_mffscrn) instead of mtfsfi. For generic powerpc ceil/floor/trunc, the function is supposed to disable the floating-point inexact exception enable bit, however mffscrni does not change any exception enable bits. This patch fixes by reverting the optimization for the __fesetround_inline_nocheck. Checked on powerpc-linux-gnu. Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
* x86_64: Fix missing wcsncat function definition without multiarch (x86-64-v4)Gabi Falk2024-05-081-3/+3
| | | | | | | | | | | | | | | | This code expects the WCSCAT preprocessor macro to be predefined in case the evex implementation of the function should be defined with a name different from __wcsncat_evex. However, when glibc is built for x86-64-v4 without multiarch support, sysdeps/x86_64/wcsncat.S defines WCSNCAT variable instead of WCSCAT to build it as wcsncat. Rename the variable to WCSNCAT, as it is actually a better naming choice for the variable in this case. Reported-by: Kenton Groombridge Link: https://bugs.gentoo.org/921945 Fixes: 64b8b6516b ("x86: Add evex optimized functions for the wchar_t strcpy family") Signed-off-by: Gabi Falk <gabifalk@gmx.com> Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* localedata: fix weekdays in mdf_RU localeMike FABIAN2024-05-081-14/+15
| | | | | | From Кирилл Изместьев <izmestevks@basealt.ru>, see: https://sourceware.org/bugzilla/show_bug.cgi?id=31530#c6 and the following comments.
* localedata: add mdf_RU localeMike FABIAN2024-05-084-0/+207
| | | | Resolves: BZ # 31530
* elf: Make glibc.rtld.enable_secure ignore alias environment variablesAdhemerval Zanella2024-05-073-24/+164
| | | | | | | | | | Tunable with environment variables aliases are also ignored if glibc.rtld.enable_secure is enabled. The tunable parsing is also optimized a bit, where the loop that checks each environment variable only checks for the tunables with aliases instead of all tables. Checked on aarch64-linux-gnu and x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* support: Add envp argument to support_capture_subprogramAdhemerval Zanella2024-05-0716-26/+30
| | | | | So tests can specify a list of environment variables. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* elf: Remove glibc.rtld.enable_secure check from parse_tunables_stringAdhemerval Zanella2024-05-071-20/+38
| | | | | | | | | And move it to parse_tunables. It avoids a string comparison for each tunable. Checked on aarch64-linux-gnu and x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* elf: Only process multiple tunable once (BZ 31686)Adhemerval Zanella2024-05-074-14/+84
| | | | | | | | | | | | | | | | | | | | | | | | The 680c597e9c3 commit made loader reject ill-formatted strings by first tracking all set tunables and then applying them. However, it does not take into consideration if the same tunable is set multiple times, where parse_tunables_string appends the found tunable without checking if it was already in the list. It leads to a stack-based buffer overflow if the tunable is specified more than the total number of tunables. For instance: GLIBC_TUNABLES=glibc.malloc.check=2:... (repeat over the number of total support for different tunable). Instead, use the index of the tunable list to get the expected tunable entry. Since now the initial list is zero-initialized, the compiler might emit an extra memset and this requires some minor adjustment on some ports. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reported-by: Yuto Maeda <maeda@cyberdefense.jp> Reported-by: Yutaro Shimizu <shimizu@cyberdefense.jp> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* NEWS: Add advisories.Carlos O'Donell2024-05-061-0/+19
| | | | | | | | | | | | | | | | | | | | | | | GLIBC-SA-2024-0004: ISO-2022-CN-EXT: fix out-of-bound writes when writing escape sequence (CVE-2024-2961) GLIBC-SA-2024-0005: nscd: Stack-based buffer overflow in netgroup cache (CVE-2024-33599) GLIBC-SA-2024-0006: nscd: Null pointer crashes after notfound response (CVE-2024-33600) GLIBC-SA-2024-0007: nscd: netgroup cache may terminate daemon on memory allocation failure (CVE-2024-33601) GLIBC-SA-2024-0008: nscd: netgroup cache assumes NSS callback uses in-buffer strings (CVE-2024-33602) Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Document CVE-2024-33599, CVE-2024-33600, CVE-2024-33601, CVE-2024-33602Carlos O'Donell2024-05-064-0/+108
| | | | | | This commit adds advisory data for the above CVE(s). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>