]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
31 hours agolocaledata: Add en_SE for ISO8601 dates master
Andreas Schneider [Mon, 21 Jul 2025 08:00:27 +0000 (10:00 +0200)] 
localedata: Add en_SE for ISO8601 dates

On a Linux system you have two sources for locales: glibc and ICU.

ICU offeres a lot more languages than glibc. Especially when it comes to
en_*.

If you have an English system and want to use ISO8601 for date and time
format there is only one locale which can be used for that: en_SE

However ICU offers en_SE and glibc doesn't. If you set LC_TIME=en_SE a
lot of application wont start, because the locale is not known to glibc.

https://sourceware.org/bugzilla/show_bug.cgi?id=33190

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Mike FABIAN <mfabian@redhat.com>
32 hours agomalloc: Fix MALLOC_DEBUG
Wilco Dijkstra [Fri, 8 Aug 2025 14:00:43 +0000 (14:00 +0000)] 
malloc: Fix MALLOC_DEBUG

MALLOC_DEBUG only works on locked arenas, so move the call to
check_inuse_chunk from __libc_free() to _int_free_chunk().
Regress now passes if MALLOC_DEBUG is enabled.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
32 hours agomalloc: Support THP in arenas
Wilco Dijkstra [Fri, 8 Aug 2025 14:00:11 +0000 (14:00 +0000)] 
malloc: Support THP in arenas

Arenas support huge pages but not transparent huge pages.  Add this by
also checking mp_.thp_pagesize when creating a new arena, and use madvise.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
32 hours agomalloc: Remove use of __curbrk
Wilco Dijkstra [Fri, 8 Aug 2025 13:59:31 +0000 (13:59 +0000)] 
malloc: Remove use of __curbrk

Remove an odd use of __curbrk and use MORECORE (0) instead.
This fixes Hurd build since it doesn't define this symbol.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2 days agoFilter machine compiler flags into Assembler Flags
Sachin Monga [Fri, 1 Aug 2025 09:35:11 +0000 (04:35 -0500)] 
Filter machine compiler flags into Assembler Flags

Assembler files may want or need to test for predefined macros which are
set via -m* compiler options, so ensure all -m* options in CFLAGS are passed
to ASFLAGS.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 days agotst-freopen4: Remove temporary directory from warning message
H.J. Lu [Tue, 5 Aug 2025 23:17:42 +0000 (16:17 -0700)] 
tst-freopen4: Remove temporary directory from warning message

tst-freopen4-main.c issues a warning message:

warning: could not remove temporary file: /tmp/tst-freopen4potgti: No such file or directory

since chroot makes generated temporary directories inaccessible.  Add
special rules for tst-freopen4.out and tst-freopen64-4.out to remove
the temporary directory in warning message from tst-freopen4 and
tst-freopen64-4.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
4 days agoRevert "tst-freopen4-main.c: Call support_capture_subprocess with chroot"
H.J. Lu [Tue, 5 Aug 2025 16:16:14 +0000 (09:16 -0700)] 
Revert "tst-freopen4-main.c: Call support_capture_subprocess with chroot"

Revert commit 6463d4a7b28e5ee3891c34a8a1f0a59c24dfa9de to fix

FAIL: stdio-common/tst-freopen4-mem
FAIL: stdio-common/tst-freopen64-4-mem

This fixes BZ #33254.

Reviewed-by: Sam James <sam@gentoo.org>
4 days agoiconv: Fix iconv functions not following symlinks [BZ #32339]
Avinal Kumar [Mon, 14 Jul 2025 16:04:27 +0000 (21:34 +0530)] 
iconv: Fix iconv functions not following symlinks [BZ #32339]

On some file systems iconv do not follow symlinks.  This happens because
read_conf_file() function's directory traversal loop reject symbolic
links and then lstat64() call do not follow symlinks.

This commit fixes the directory traversal loop to accept symbolic links
and then follow the link using stat64().

The test works by creating a temporary directory and placing a symbolic
link inside it that points to a configuration file.  It then runs
iconvconfig on this directory.

The test passes if iconvconfig successfully follows the symlink and
generates the cache correctly, confirming that the directory traversal
logic now properly handles symbolic links.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Reviewed-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
4 days agoLinux: Add test case for bug 33245
Florian Weimer [Sat, 2 Aug 2025 10:44:51 +0000 (12:44 +0200)] 
Linux: Add test case for bug 33245

The copy_file_range system call seems to be the only one that can
return an off64_t value.  Use FUSE to exercise this, without actually
creating such large files or copying any data.  Due to FUSE protocol
limitations, only sizes up to UINT_MAX can be tested, but this is
sufficient to check for the presence of bug 33245.

The FUSE protocol limitations are raised here:

  copy_file_range return value on FUSE
  <https://lore.kernel.org/all/lhuh5ynl8z5.fsf@oldenburg.str.redhat.com/>

Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
4 days agoUse TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [BZ #33234]
Jens Remus [Fri, 25 Jul 2025 13:40:03 +0000 (15:40 +0200)] 
Use TLS initial-exec model for __libc_tsd_CTYPE_* thread variables [BZ #33234]

Commit 10a66a8e421b ("Remove <libc-tsd.h>") removed the TLS initial-exec
(IE) model attribute from the __libc_tsd_CTYPE_* thread variable declarations
and definitions.  Commit a894f04d8776 ("Optimize __libc_tsd_* thread
variable access") restored it on declarations.

Restore the TLS initial-exec model attribute on __libc_tsd_CTYPE_* thread
variable definitions.

This resolves test tst-locale1 failure on s390 32-bit, when using a
GNU linker without the fix from GNU binutils commit aefebe82dc89
("IBM zSystems: Fix offset relative to static TLS").

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 days agoiconv: use bswap_32 instead of __builtin_bswap32
Collin Funk [Tue, 5 Aug 2025 08:07:18 +0000 (10:07 +0200)] 
iconv: use bswap_32 instead of __builtin_bswap32

This file uses a mix of both functions, prefer the non-builtin version.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
5 days agotst-env-setuid: Delete LD_DEBUG_OUTPUT output
H.J. Lu [Sat, 19 Jul 2025 14:43:29 +0000 (07:43 -0700)] 
tst-env-setuid: Delete LD_DEBUG_OUTPUT output

Update tst-env-setuid.c to delete LD_DEBUG_OUTPUT output, instead of
leaving it behind.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agotst-freopen4-main.c: Call support_capture_subprocess with chroot
H.J. Lu [Sat, 19 Jul 2025 14:43:28 +0000 (07:43 -0700)] 
tst-freopen4-main.c: Call support_capture_subprocess with chroot

Update tst-freopen4-main.c to call support_capture_subprocess with chroot,
which makes temporary files inaccessible, so that temporary files can be
deleted.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agotst-fopen-threaded.c: Delete temporary file
H.J. Lu [Sat, 19 Jul 2025 14:43:27 +0000 (07:43 -0700)] 
tst-fopen-threaded.c: Delete temporary file

Update tst-fopen-threaded.c to call support_create_temp_directory to
create a temporary directory and open "file" in the temporary directory,
instead of using /tmp/openclosetest and leaving it behind.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agoDelete temporary files in support_subprocess
H.J. Lu [Sat, 19 Jul 2025 14:43:26 +0000 (07:43 -0700)] 
Delete temporary files in support_subprocess

Call support_delete_temp_files to delete temporary files before exit in
support_subprocess.

This partially fixes BZ #33182.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agoRevert "Remove use of __curbrk."
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:56 +0000 (17:31 +0000)] 
Revert "Remove use of __curbrk."

This reverts commit 1ee0b771a9c0cd2b882fe7acd38deddb7d4fbef2.

5 days agoRevert "Improve MALLOC_DEBUG"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:54 +0000 (17:31 +0000)] 
Revert "Improve MALLOC_DEBUG"

This reverts commit 4b3e65682d1895a651653d82f05c66ead8dfcf3b.

5 days agoRevert "Enable THP on arenas"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:52 +0000 (17:31 +0000)] 
Revert "Enable THP on arenas"

This reverts commit 77d3e739360ebb49bae6ecfd4181e4e1692f6362.

5 days agoRevert "benchtests: Avoid overflow in random memcpy/memset benchmarks"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:51 +0000 (17:31 +0000)] 
Revert "benchtests: Avoid overflow in random memcpy/memset benchmarks"

This reverts commit 09604542d31abf1e35cd00c1db8d9bee9568bdd0.

5 days agoRevert "Use _int_free_chunk in tcache_thread_shutdown"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:49 +0000 (17:31 +0000)] 
Revert "Use _int_free_chunk in tcache_thread_shutdown"

This reverts commit 05ef6a49746faedb4262db1476449c1c2c822e95.

5 days agoRevert "Remove dumped heap support"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:47 +0000 (17:31 +0000)] 
Revert "Remove dumped heap support"

This reverts commit 8f57caa7fdcb7ab3016897a056ccf386061e7734.

5 days agoRevert "malloc: Cleanup libc_realloc"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:45 +0000 (17:31 +0000)] 
Revert "malloc: Cleanup libc_realloc"

This reverts commit dea1e52af38c20eae37ec09727f17ab8fde87f55.

5 days agoRevert "Change mmap representation"
Wilco Dijkstra [Mon, 4 Aug 2025 17:31:40 +0000 (17:31 +0000)] 
Revert "Change mmap representation"

This reverts commit 4b74591022e88639dcaefb8c4a2e405d301a59e2.

5 days agoRemove use of __curbrk.
Wilco Dijkstra [Mon, 4 Aug 2025 12:45:56 +0000 (12:45 +0000)] 
Remove use of __curbrk.

5 days agoImprove MALLOC_DEBUG
Wilco Dijkstra [Sat, 2 Aug 2025 17:18:57 +0000 (17:18 +0000)] 
Improve MALLOC_DEBUG

5 days agoEnable THP on arenas
Wilco Dijkstra [Wed, 30 Jul 2025 15:04:35 +0000 (15:04 +0000)] 
Enable THP on arenas

5 days agobenchtests: Avoid overflow in random memcpy/memset benchmarks
Wilco Dijkstra [Tue, 20 May 2025 15:56:14 +0000 (15:56 +0000)] 
benchtests: Avoid overflow in random memcpy/memset benchmarks

Use uint16_t rather than uint8_t for the size arrays.

5 days agoUse _int_free_chunk in tcache_thread_shutdown
Wilco Dijkstra [Thu, 3 Apr 2025 14:24:22 +0000 (14:24 +0000)] 
Use _int_free_chunk in tcache_thread_shutdown

5 days agoRemove dumped heap support
Wilco Dijkstra [Fri, 25 Jul 2025 12:16:40 +0000 (12:16 +0000)] 
Remove dumped heap support

5 days agomalloc: Cleanup libc_realloc
Wilco Dijkstra [Wed, 28 May 2025 15:17:43 +0000 (15:17 +0000)] 
malloc: Cleanup libc_realloc

Minor cleanup of libc_realloc: remove unnecessary special cases for mmap, move
ar_ptr initialization, first check for oldmem == NULL.

5 days agoChange mmap representation
Wilco Dijkstra [Thu, 10 Jul 2025 15:59:37 +0000 (15:59 +0000)] 
Change mmap representation

5 days agomanual: Adjust documentation to standardization of select
Collin Funk [Sat, 26 Jul 2025 04:15:12 +0000 (21:15 -0700)] 
manual: Adjust documentation to standardization of select

The select function, fd_set, and FD_* macros were standardized by POSIX
in the sys/select.h header. They are still defined in sys/types.h if
__USE_MISC is defined, but we should recommend the more portable and
standardized sys/select.h.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agomanual: Use sys/select.h instead of sys/time.h for select example.
Collin Funk [Fri, 25 Jul 2025 00:44:10 +0000 (17:44 -0700)] 
manual: Use sys/select.h instead of sys/time.h for select example.

The original example works on glibc since sys/time.h includes
sys/select.h. However, since POSIX requires that select is defined in
sys/select.h this change makes the example more portable.

Reported by Gavin Smith <gavinsmith0123@gmail.com> in:
<https://lists.gnu.org/archive/html/bug-texinfo/2025-07/msg00091.html>.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agomanual: document getsubopt standardization.
Collin Funk [Sat, 28 Jun 2025 06:13:48 +0000 (23:13 -0700)] 
manual: document getsubopt standardization.

The getsubopt function was an XSI extension since POSIX issue 4 until it
was added to Base in POSIX Issue 7.  This also adds the 'restrict'
qualifier to the arguments as done in POSIX.1-2024, and has been the
case in glibc.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
5 days agoerrlist: add missing entries for MIPS/SPARC
Luca Boccassi [Tue, 29 Jul 2025 12:07:58 +0000 (13:07 +0100)] 
errlist: add missing entries for MIPS/SPARC

These are defined in the kernel headers but missing from the list
of names, so strerrorname_np() returns NULL.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/errno.h#n95
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/sparc/include/uapi/asm/errno.h#n55

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 days agohurd: support: Fix running SGID tests
Samuel Thibault [Fri, 18 Jul 2025 21:14:40 +0000 (23:14 +0200)] 
hurd: support: Fix running SGID tests

Secure mode is enabled only if SGID actually provides a new privilege,
so we have to drop it before gaining it again.

Fixes commit 3a3fb2ed83f79100c116c824454095ecfb335ad7
("Fix error reporting (false negatives) in SGID tests")

6 days agosupport: Handle COPY_FILE_RANGE events with FUSE
Florian Weimer [Sat, 2 Aug 2025 10:35:34 +0000 (12:35 +0200)] 
support: Handle COPY_FILE_RANGE events with FUSE

7 days agomalloc: Cleanup sysmalloc_mmap
Wilco Dijkstra [Sat, 2 Aug 2025 15:11:28 +0000 (15:11 +0000)] 
malloc: Cleanup sysmalloc_mmap

Cleanup sysmalloc_mmap - simplify padding since it is always a constant.
Remove av parameter which is only used in do_check_chunk, but since it may be
NULL for mmap, it will cause a crash in checking mode.  Remove the odd check
on mmap in do_check_chunk.

Reviewed-by: DJ Delorie <dj@redhat.com>
7 days agomalloc: Improve checked_request2size
Wilco Dijkstra [Fri, 6 Jun 2025 17:11:36 +0000 (17:11 +0000)] 
malloc: Improve checked_request2size

Change checked_request2size to return SIZE_MAX for huge inputs.  This
ensures large allocation requests stay large and can't be confused with a
small allocation.  As a result several existing checks against PTRDIFF_MAX
become redundant.

Reviewed-by: DJ Delorie <dj@redhat.com>
7 days agomalloc: Cleanup madvise defines
Wilco Dijkstra [Thu, 10 Jul 2025 16:04:24 +0000 (16:04 +0000)] 
malloc: Cleanup madvise defines

Remove redundant ifdefs for madvise/THP.

Reviewed-by: DJ Delorie <dj@redhat.com>
7 days agobenchtests: Cleanup bench-malloc-thread
Wilco Dijkstra [Fri, 9 May 2025 14:24:42 +0000 (14:24 +0000)] 
benchtests: Cleanup bench-malloc-thread

Change duration to 3 seconds.  Add spaces before '('.

Reviewed-by: DJ Delorie <dj@redhat.com>
7 days agomalloc: Fix MAX_TCACHE_SMALL_SIZE
Wilco Dijkstra [Thu, 17 Jul 2025 14:31:06 +0000 (14:31 +0000)] 
malloc: Fix MAX_TCACHE_SMALL_SIZE

MAX_TCACHE_SMALL_SIZE should use chunk size since it is used after
checked_request2size.  Increase limit of tcache_max_bytes by 1 since all
comparisons use '<'.  As a result, the last tcache entry is now used as
expected.

Reviewed-by: DJ Delorie <dj@redhat.com>
8 days agonptl: Fix SYSCALL_CANCEL for return values larger than INT_MAX (BZ 33245)
Adhemerval Zanella [Fri, 1 Aug 2025 18:00:25 +0000 (15:00 -0300)] 
nptl: Fix SYSCALL_CANCEL for return values larger than INT_MAX (BZ 33245)

The SYSCALL_CANCEL calls __syscall_cancel, which in turn
calls __internal_syscall_cancel with an 'int' return instead of the
expected 'long int'.  This causes issues with syscalls that return
values larger than INT_MAX, such as copy_file_range [1].

Checked on x86_64-linux-gnu.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79139

Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
8 days agoi386: Consolidate subdirectory check on elf and csu
H.J. Lu [Mon, 28 Jul 2025 19:15:30 +0000 (12:15 -0700)] 
i386: Consolidate subdirectory check on elf and csu

Consolidate subdirectory check on elf and csu to avoid checking them
more than once.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
8 days agox86-64: Consolidate subdirectory check on elf and csu
H.J. Lu [Mon, 28 Jul 2025 19:15:11 +0000 (12:15 -0700)] 
x86-64: Consolidate subdirectory check on elf and csu

Consolidate subdirectory check on elf and csu to avoid checking them
more than once.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
8 days agoelf: Handle ld.so with LOAD segment gaps in _dl_find_object (bug 31943)
Florian Weimer [Fri, 1 Aug 2025 08:20:23 +0000 (10:20 +0200)] 
elf: Handle ld.so with LOAD segment gaps in _dl_find_object (bug 31943)

Detect if ld.so not contiguous and handle that case in _dl_find_object.
Set l_find_object_processed even for initially loaded link maps,
otherwise dlopen of an initially loaded object adds it to
_dlfo_loaded_mappings (where maps are expected to be contiguous),
in addition to _dlfo_nodelete_mappings.

Test elf/tst-link-map-contiguous-ldso iterates over the loader
image, reading every word to make sure memory is actually mapped.
It only does that if the l_contiguous flag is set for the link map.
Otherwise, it finds gaps with mmap and checks that _dl_find_object
does not return the ld.so mapping for them.

The test elf/tst-link-map-contiguous-main does the same thing for
the libc.so shared object.  This only works if the kernel loaded
the main program because the glibc dynamic loader may fill
the gaps with PROT_NONE mappings in some cases, making it contiguous,
but accesses to individual words may still fault.

Test elf/tst-link-map-contiguous-libc is again slightly different
because the dynamic loader always fills the gaps with PROT_NONE
mappings, so a different form of probing has to be used.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
8 days agoelf: Extract rtld_setup_phdr function from dl_main
Florian Weimer [Fri, 1 Aug 2025 08:20:23 +0000 (10:20 +0200)] 
elf: Extract rtld_setup_phdr function from dl_main

Remove historic binutils reference from comment and update
how this data is used by applications.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
9 days agostdlib: resolve a double lock init issue after fork [BZ #32994]
Davide Cavalca [Thu, 31 Jul 2025 15:32:58 +0000 (17:32 +0200)] 
stdlib: resolve a double lock init issue after fork [BZ #32994]

The __abort_fork_reset_child (introduced in
d40ac01cbbc66e6d9dbd8e3485605c63b2178251) call resets the lock after the
fork. This causes a DRD regression in valgrind
(https://bugs.kde.org/show_bug.cgi?id=503668), as it's effectively a
double initialization, despite it being actually ok in this case. As
suggested in https://sourceware.org/bugzilla/show_bug.cgi?id=32994#c2
we replace it here with a memcpy of another initialized lock instead,
which makes valgrind happy.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
11 days agoUse Linux 6.16, GCC 15, binutils 2.45 in build-many-glibcs.py
Joseph Myers [Tue, 29 Jul 2025 15:08:09 +0000 (15:08 +0000)] 
Use Linux 6.16, GCC 15, binutils 2.45 in build-many-glibcs.py

Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).

11 days agomalloc: Enable THP always support on hugetlb tunable
William Hunt [Tue, 29 Jul 2025 15:04:58 +0000 (15:04 +0000)] 
malloc: Enable THP always support on hugetlb tunable

Enable support for THP always when glibc.malloc.hugetlb=1, as the tunable
currently only gives explicit support in malloc for the THP madvise mode
by aligning to a huge page size. Add a thp_mode parameter to mp_ and check
in madvise_thp whether the system is using madvise mode, otherwise the
`__madvise` call is useless. Set the thp_mode to be unsupported by default,
but if the hugetlb tunable is set this updates thp_mode. Performance of
xalancbmk improves by 4.9% on Neoverse V2 when THP always mode is set on the
system and glibc.malloc.hugetlb=1.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
11 days agomalloc: Remove redundant NULL check
Wilco Dijkstra [Thu, 10 Jul 2025 15:49:14 +0000 (15:49 +0000)] 
malloc: Remove redundant NULL check

Remove a redundant NULL check from tcache_get_n.

Reviewed-by: Cupertino Miranda <cupertino.miranda@oracle.com>
11 days agoreplace atan2-inputs with more meaningful inputs
Paul Zimmermann [Wed, 9 Jul 2025 08:11:23 +0000 (10:11 +0200)] 
replace atan2-inputs with more meaningful inputs

Commit 934d88d used inputs with exponent generated at random in the
whole binary64 exponent range, which yields essentially very large
or very small values of |y/x|. Instead, this commit generates x, y at
random in [-10,10], which should better corresponds to real applications.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
11 days agoinet-fortified: fix namespace violation (bug 33227)
Sam James [Mon, 28 Jul 2025 20:55:30 +0000 (21:55 +0100)] 
inet-fortified: fix namespace violation (bug 33227)

We need to use __sz, not sz, as we do elsewhere.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
11 days agotst-cond23: return EXIT_UNSUPPORTED on missing clock selection
Samuel Thibault [Tue, 29 Jul 2025 09:56:06 +0000 (11:56 +0200)] 
tst-cond23: return EXIT_UNSUPPORTED on missing clock selection

12 days agoNEWS: Add 2.43 section
Andreas K. Hüttel [Mon, 28 Jul 2025 18:33:18 +0000 (20:33 +0200)] 
NEWS: Add 2.43 section

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agoBump version to 2.42.9000 glibc-2.42.9000
Andreas K. Hüttel [Mon, 28 Jul 2025 18:31:31 +0000 (20:31 +0200)] 
Bump version to 2.42.9000

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agoCreate ChangeLog.old/ChangeLog.31 glibc-2.42
Andreas K. Hüttel [Mon, 28 Jul 2025 18:22:55 +0000 (20:22 +0200)] 
Create ChangeLog.old/ChangeLog.31

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agoBump version number to 2.42
Andreas K. Hüttel [Mon, 28 Jul 2025 18:19:17 +0000 (20:19 +0200)] 
Bump version number to 2.42

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agoNEWS: update with last-minute fix bug 33224
Andreas K. Hüttel [Mon, 28 Jul 2025 18:12:05 +0000 (20:12 +0200)] 
NEWS: update with last-minute fix bug 33224

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agomath: Update auto-libm-tests-in with ldbl-128ibm compoundn/pown failures
Adhemerval Zanella [Mon, 28 Jul 2025 13:59:07 +0000 (10:59 -0300)] 
math: Update auto-libm-tests-in with ldbl-128ibm compoundn/pown failures

It fixes ce488f7c1615bc2f6fe96ff4d51456e470aa5805 which updated
the out files without using gen-auto-libm-tests.c instructions.

Checked on powerpc64le-linux-gnu.

Tested-by: Andreas K. Huettel <dilfridge@gentoo.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
12 days agoINSTALL: Update newest tested binutils version
Andreas K. Hüttel [Mon, 28 Jul 2025 14:49:01 +0000 (16:49 +0200)] 
INSTALL: Update newest tested binutils version

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
12 days agoelf: Compile _dl_debug_state separately (bug 33224)
Florian Weimer [Mon, 28 Jul 2025 12:16:52 +0000 (14:16 +0200)] 
elf: Compile _dl_debug_state separately (bug 33224)

This ensures that the compiler will not inline it, so that
debuggers which do not use the Systemtap probes can reliably
set a breakpoint on it.

Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
Tested-by: Andreas K. Huettel <dilfridge@gentoo.org>
12 days agoconfigure.ac: fix bashisms in SFrame checks
Sam James [Mon, 28 Jul 2025 13:00:52 +0000 (14:00 +0100)] 
configure.ac: fix bashisms in SFrame checks

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agoINSTALL: regenerate
Andreas K. Hüttel [Sat, 26 Jul 2025 15:07:14 +0000 (17:07 +0200)] 
INSTALL: regenerate

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoinstall.texi: Update tested build tool versions
Andreas K. Hüttel [Sat, 26 Jul 2025 15:05:21 +0000 (17:05 +0200)] 
install.texi: Update tested build tool versions

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agocontrib.texi: Update
Andreas K. Hüttel [Sat, 26 Jul 2025 14:53:43 +0000 (16:53 +0200)] 
contrib.texi: Update

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoNEWS: insert list of CVEs
Andreas K. Hüttel [Sat, 26 Jul 2025 13:23:49 +0000 (15:23 +0200)] 
NEWS: insert list of CVEs

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoadvisories: s/CVE-id/CVE-Id/ (the lowercase i breaks our tooling)
Andreas K. Hüttel [Sat, 26 Jul 2025 13:21:27 +0000 (15:21 +0200)] 
advisories: s/CVE-id/CVE-Id/ (the lowercase i breaks our tooling)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoNEWS: Generalize testing section and mention the manual.
Carlos O'Donell [Fri, 25 Jul 2025 22:38:59 +0000 (18:38 -0400)] 
NEWS: Generalize testing section and mention the manual.

2 weeks agoNEWS: Insert list of bugs fixed in 2.42
Andreas K. Hüttel [Fri, 25 Jul 2025 21:52:41 +0000 (23:52 +0200)] 
NEWS: Insert list of bugs fixed in 2.42

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoNEWS: Collect some more newsworthy items
Andreas K. Hüttel [Fri, 25 Jul 2025 21:36:56 +0000 (23:36 +0200)] 
NEWS: Collect some more newsworthy items

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoNEWS: editorial changes
Andreas K. Hüttel [Fri, 25 Jul 2025 19:18:13 +0000 (21:18 +0200)] 
NEWS: editorial changes

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agopo: Update swedish translations
Andreas K. Hüttel [Fri, 25 Jul 2025 17:31:37 +0000 (19:31 +0200)] 
po: Update swedish translations

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agodebug: Only run sframe tests if run-built-tests is enabled
Adhemerval Zanella [Fri, 25 Jul 2025 17:03:23 +0000 (14:03 -0300)] 
debug: Only run sframe tests if run-built-tests is enabled

2 weeks agoaarch64: Fix aarch64_be build with --enable-sframe
Adhemerval Zanella [Fri, 25 Jul 2025 16:57:44 +0000 (13:57 -0300)] 
aarch64: Fix aarch64_be build with --enable-sframe

2 weeks agoelf: Check SFrame on tst-dl_find_object.c
Adhemerval Zanella [Tue, 22 Jul 2025 15:55:52 +0000 (12:55 -0300)] 
elf: Check SFrame on tst-dl_find_object.c

If SFrame is enable check if DLFO_FLAG_SFRAME is set (since sframe
support is added by default) and if dlfo_sframe has the expected
value.

Checked on aarch64-linux-gnu and x86_64-linux-gnu.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agosframe: Add support for SFRAME_F_FDE_FUNC_START_PCREL flag
Claudiu Zissulescu [Tue, 22 Jul 2025 15:55:51 +0000 (12:55 -0300)] 
sframe: Add support for SFRAME_F_FDE_FUNC_START_PCREL flag

The Sframe V2 has a new errata which introduces the
SFRAME_F_FDE_FUNC_START_PCREL flag. This flag indicates the encoding
of the SFrame FDE function start address field like this:

- if set, sfde_func_start_address field contains the offset in bytes
to the start PC of the associated function from the field itself.

- if unset, sfde_func_start_address field contains the offset in bytes
to the start PC of the associated function from the start of the
SFrame section.

Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agoDisable SFrame support by default
Adhemerval Zanella [Tue, 22 Jul 2025 15:55:50 +0000 (12:55 -0300)] 
Disable SFrame support by default

And add extra checks to enable for binutils 2.45 and if the architecture
explicitly enables it.  When SFrame is disabled, all the related code
is also not enabled for backtrace() and _dl_find_object(), so SFrame
backtracking is not used even if the binary has the SFrame segment.

This patch also adds some other related fixes:

  * Fixed an issue with AC_CHECK_PROG_VER, where the READELF_SFRAME
    usage prevented specifying a different readelf through READELF
    environment variable at configure time.

  * Add an extra arch-specific internal definition,
    libc_cv_support_sframe, to disable --enable-sframe on architectures
    that have binutils but not glibc support (s390x).

  * Renamed the tests without the .sframe segment and move the
    tst-backtrace1 from pthread to debug.

  * Use the built compiler strip to remove the .sframe segment,
    instead of the system one (which might not support SFrame).

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agomath: xfail some pown and compoundn tests for ibm128-libgcc
Sachin Monga [Wed, 23 Jul 2025 16:43:52 +0000 (11:43 -0500)] 
math: xfail some pown and compoundn tests for ibm128-libgcc

On powerpc math/test-ibm128-pown shows below failures:

testing long double (without inline functions)
infinity has wrong sign.
Failure: Test: pown_downward (-inf, 0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
Failure: Test: pown_downward (-0, 9223372036854775807LL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: pown_downward (-0x1p+0, 9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_downward (-0x1p+0, 9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_downward (-0x1p+0, 9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0
infinity has wrong sign.
Failure: Test: pown_towardzero (-0, -0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
infinity has wrong sign.
Failure: Test: pown_towardzero (-inf, 0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
Failure: Test: pown_towardzero (-inf, -0x7fffffffffffffffLL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: Test: pown_towardzero (-0, 9223372036854775807LL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: pown_towardzero (-0x1p+0, -9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_towardzero (-0x1p+0, -9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_towardzero (-0x1p+0, -9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0
Failure: pown_towardzero (-0x1p+0, 9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_towardzero (-0x1p+0, 9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_towardzero (-0x1p+0, 9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0
infinity has wrong sign.
Failure: Test: pown_upward (-0, -0x7fffffffffffffffLL)
Result:
 is:          inf   inf
 should be:  -inf  -inf
Failure: Test: pown_upward (-inf, -0x7fffffffffffffffLL)
Result:
 is:          0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 should be:  -0.00000000000000000000000000000000e+00  -0x0.000000000000000000000000000p+0
 difference:  0.00000000000000000000000000000000e+00   0x0.000000000000000000000000000p+0
 ulp       :  0.0000
 max.ulp   :  16.0000
Failure: pown_upward (-0x1p+0, -9223372036854775807LL): Exception "Invalid operation" set
Failure: pown_upward (-0x1p+0, -9223372036854775807LL): errno set to 34, expected 0 (unchanged)
Failure: Test: pown_upward (-0x1p+0, -9223372036854775807LL)
Result:
 is:         qNaN
 should be:  -1.00000000000000000000000000000000e+00  -0x1.000000000000000000000000000p+0

Likewise, math/test-ibm128-compoundn shows below failure:

testing long double (without inline functions)
Failure: compoundn_upward (0xf.ffffffffffff8p+1020, 1LL): Exception "Overflow" set
Failure: compoundn_upward (0xf.ffffffffffff8p+1020, 1LL): errno set to 34, expected 0 (unchanged)
Failure: Test: compoundn_upward (0xf.ffffffffffff8p+1020, 1LL)
Result:
 is:          inf   inf
 should be:   1.79769313486231570814527423731707e+308   0x1.fffffffffffff00000000000008p+1023

Signed-off-by: Sachin Monga <smonga@linux.ibm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agomanual: Use @Theglibc{} at sentence start in terminal documentation
Florian Weimer [Tue, 22 Jul 2025 21:28:16 +0000 (23:28 +0200)] 
manual: Use @Theglibc{} at sentence start in terminal documentation

Fixes commit 5dd2a19ad5218261cee064 ("termios: manual: improve the
explanation of various tty concepts") and commit c744519bad8106769760
("termios: manual: document the SPEED_MAX and BAUD_MAX constants").

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agoUpdate Fix-Commit list for advisory GLIBC-SA-2025-0002
Carlos O'Donell [Thu, 24 Jul 2025 15:12:02 +0000 (11:12 -0400)] 
Update Fix-Commit list for advisory GLIBC-SA-2025-0002

2 weeks agodebug: Link tst-sprintf-fortify-rdonly-static with -Wl,-z,relro [BZ 33183]
John David Anglin [Thu, 24 Jul 2025 14:53:35 +0000 (10:53 -0400)] 
debug: Link tst-sprintf-fortify-rdonly-static with -Wl,-z,relro [BZ 33183]

This test requires relro_format be placed in the PT_GNU_RELRO segment.
The ELF linker enables -z relro support by default on all Linux targets
except FRV, HPPA, IA64 and MIPS. On these targets, we need to explicitly
link with -z relro to place relro_format in the PT_GNU_RELRO segment.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
2 weeks agoAdvisory text for CVE-2025-8058
Adhemerval Zanella [Wed, 23 Jul 2025 19:09:19 +0000 (16:09 -0300)] 
Advisory text for CVE-2025-8058

The fix is already installed (7ea06e994093fa0bcca0d0ee2c1db271d8d7885d).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 weeks agoMakeconfig: The hash character # confuses old make, use $(dir instead of sed
Andreas K. Hüttel [Mon, 21 Jul 2025 21:48:43 +0000 (23:48 +0200)] 
Makeconfig: The hash character # confuses old make, use $(dir instead of sed

Up to Make 4.2, # is treated as the start of a comment even in
function invocations. This leads to a syntax error. Fixed in Make 4.3,
but we still support versions back to 4.0 at the moment.

Tested on Gentoo (x86-64) and Debian (loongarch64)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agopo: Incorporate translations
Andreas K. Hüttel [Mon, 21 Jul 2025 22:28:48 +0000 (00:28 +0200)] 
po: Incorporate translations

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 weeks agoposix: Fix double-free after allocation failure in regcomp (bug 33185)
Florian Weimer [Mon, 21 Jul 2025 19:43:49 +0000 (21:43 +0200)] 
posix: Fix double-free after allocation failure in regcomp (bug 33185)

If a memory allocation failure occurs during bracket expression
parsing in regcomp, a double-free error may result.

Reported-by: Anastasia Belova <abelova@astralinux.ru>
Co-authored-by: Paul Eggert <eggert@cs.ucla.edu>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
2 weeks agoRevert "Linux: Keep termios ioctl constants strictly internal"
Florian Weimer [Mon, 21 Jul 2025 13:12:44 +0000 (15:12 +0200)] 
Revert "Linux: Keep termios ioctl constants strictly internal"

This reverts commit 3d3572f59059e2b19b8541ea648a6172136ec42e.

Reason for revert: TCGETS etc. work to some extent on at least
a subset of architectures, so there is no pressing need to force
applications off them.  Removal of the macros breaks building
the sanitizers, impacting both GCC and LLVM.

Reviewed-by: Sam James <sam@gentoo.org>
2 weeks agotermios: manual: document the SPEED_MAX and BAUD_MAX constants
H. Peter Anvin [Sun, 13 Jul 2025 05:19:44 +0000 (22:19 -0700)] 
termios: manual: document the SPEED_MAX and BAUD_MAX constants

Add the SPEED_MAX and BAUD_MAX constants to the manual.

[ v3: drop leading underscores ]

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agotermios: SPEED_MAX and BAUD_MAX constants
H. Peter Anvin [Sun, 13 Jul 2025 05:19:43 +0000 (22:19 -0700)] 
termios: SPEED_MAX and BAUD_MAX constants

Add constants indicating the maximum values of speed_t and baud_t.
Hopefully if and when the baud_t interface is standardized then
BAUD_MAX will be included in the standardization from the start.

Historically, the __MAX_BAUD symbol has indicated the maximum speed_t
value on at least some platforms (including glibc).  However, this
name would be problematic for future standardization, because it
confusingly implies a reference to baud_t, not speed_t, and it is
inconsistent with other limit symbols, which are all of the form *_MAX
(e.g. SIZE_MAX for size_t.)

[ v3: dropped leading underscores, leave __MAX_BAUD outside
      #ifdef __USE_MISC since it is a legacy symbol, and
      namespace-protected with a double underscore.
      (Collin Funk, Adhermerval Zanella Netto) ]

[ v4: moved from __USE_MISC to __USE_GNU (Collin Funk) ]

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agotermios: move the baud_t interface from __USE_MISC to __USE_GNU
H. Peter Anvin [Sun, 13 Jul 2025 05:19:42 +0000 (22:19 -0700)] 
termios: move the baud_t interface from __USE_MISC to __USE_GNU

__USE_MISC refers to interfaces imported from BSD or System V, but the
baud_t interface is (at least for now) a GNU extension, so move it
from __USE_MISC to __USE_GNU.

Suggested-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agotermios: manual: improve the explanation of various tty concepts
H. Peter Anvin [Sun, 13 Jul 2025 02:20:04 +0000 (19:20 -0700)] 
termios: manual: improve the explanation of various tty concepts

It is a lot easier to understand the meaning of the tty interface if
it is explained from the beginning as conceptually emulating an RS232
serial port.  This greatly simplifies the discussions of specific
items like the meaning of line speed.

Distinguish between "modem disconnect request" (deasserting DTR) and
"modem disconnect" (DCD deasserted).  Conflating the two terms is
confusing, especially for non-RS232 devices.  In particular, on most
systems, a pseudo-terminal will *not* respond to a modem disconnect
request by triggering a modem disconnect event for the purpose of the
HUPCL flag.

It is not necessarily true that the line speed has no effect on
non-serial port devices: e.g. an SPI port may interpret it as the
clock frequency to use; however, SPI does not use asynchronous framing
bits, instead synchronization is handled by the SS# wire.  Similarly,
it is common but not by any means universal for interfaces that employ
various forms of fixed data to symbol rate encodings to encode the
data link layer bit rate rather than the physical symbol rate, which
may be higher (e.g. 8B10B) or lower (e.g. QAM/Trellis), without the
encoding or framing overhead.

Finally, a handful of devices use the line rate for entirely
nonstandard purposes.  One example is Arduino USB interfaces, which
often interprets changing the baud rate to 1200 baud as a command to
reset the device.

[ v2: removed a bogus stray chunk from editing ]

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 weeks agotermios: manual: remove duplicate cfgetospeed() definition
H. Peter Anvin [Sun, 13 Jul 2025 02:20:03 +0000 (19:20 -0700)] 
termios: manual: remove duplicate cfgetospeed() definition

The function cfsetospeed() is defined twice in the manual. Remove the
one that seems out of place.

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2 weeks agotermios: manual: fix typo: tcsettattr -> tcsetattr
H. Peter Anvin [Sun, 13 Jul 2025 02:20:02 +0000 (19:20 -0700)] 
termios: manual: fix typo: tcsettattr -> tcsetattr

Fix a typo in the manual: tcsetattr misspelled as tcsettattr.

Signed-off-by: "H. Peter Anvin" (Intel) <hpa@zytor.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
3 weeks agolibc.pot: regenerate
Andreas K. Hüttel [Sat, 19 Jul 2025 20:23:09 +0000 (22:23 +0200)] 
libc.pot: regenerate

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
3 weeks agoio/tst-stat.c: Use a temporary directory for symlink test
H.J. Lu [Sat, 19 Jul 2025 00:03:04 +0000 (17:03 -0700)] 
io/tst-stat.c: Use a temporary directory for symlink test

Call support_create_temp_directory to create a temporary directory for
symlink test, instead of a fixed file in the glibc source tree, to avoid
the race condition when there are more than one glibc tests running at the
same time with the same glibc source tree.  This fixes BZ #33178.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
3 weeks agoelf: Initialize GLRO (dl_read_only_area) after static dlopen (bug 33139)
Florian Weimer [Fri, 18 Jul 2025 17:58:59 +0000 (19:58 +0200)] 
elf: Initialize GLRO (dl_read_only_area) after static dlopen (bug 33139)

The _dl_read_only_area function in the uninitialized ld.so after
static dlopen is not able to find anything.  Instead, we need to
redirect to the code from the statically linked main program.

Fixes commit d60fffe28a46b2a41fc308c1804ff02375d27408 ("debug:
Improve '%n' fortify detection (BZ 30932)").

Reviewed-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
3 weeks agodebug: Do not link tst-sprintf-fortify-rdonly against the dlopen module
Florian Weimer [Fri, 18 Jul 2025 17:58:56 +0000 (19:58 +0200)] 
debug: Do not link tst-sprintf-fortify-rdonly against the dlopen module

The test intends to load tst-sprintf-fortify-rdonly-dlopen.so via
dlopen, and directly linking against it prevents that.

Reviewed-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
3 weeks agox86-64: Properly compile ISA optimized modf and modff
H.J. Lu [Thu, 17 Jul 2025 23:00:42 +0000 (16:00 -0700)] 
x86-64: Properly compile ISA optimized modf and modff

There are 3 variants of modf and modff: SSE2, SSE4.1 and AVX.  s_modf.c
and s_modff.c include the generic implementation compiled with the minimum
x86 ISA level.  The IFUNC selector is used only if the minimum ISA level
is less than AVX.  SSE4.1 variant is included only if the ISA level is
less than SSE4.1.  AVX variant is included only the ISA level is less than
AVX.

AVX variant should be compiled with -mavx, not -msse2avx -DSSE2AVX which
are used to encode SSE assembly sources with EVEX encoding.

The routines that are shared between libc and libm should use different
rules to avoid using the same MODULE_NAME, to avoid potential issues
like BZ #33165 where __stack_chk_fail not being routed to the internal
symbol.

Tested with -march=x86-64, -march=x86-64-v2, -march=x86-64-v3 and
-march=x86-64-v4.

This fixes BZ #33165 and BZ #33173.

Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 weeks agox86-64: Compile ISA versions of modf/modff with -fno-stack-protector
H.J. Lu [Thu, 17 Jul 2025 00:17:34 +0000 (17:17 -0700)] 
x86-64: Compile ISA versions of modf/modff with -fno-stack-protector

Since modf and modff are compiled into both libc and libm, when glibc is
configured with --enable-stack-protector=all, ISA versions of modf and
modff should be compiled with -fno-stack-protector to avoid calling
__stack_chk_fail via PLT in libc.so.

This fixes BZ #33165.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
3 weeks agoiconv: iconv -o should not create executable files (bug 33164)
Florian Weimer [Thu, 17 Jul 2025 12:44:05 +0000 (14:44 +0200)] 
iconv: iconv -o should not create executable files (bug 33164)

The mistake is that open must use 0666 to pick up the umask,
and not 0777 (which is required by mkdir).

Fixes commit 8ef3cff9d1ceafe369f982d980678d749fb93bd2
("iconv: Support in-place conversions (bug 10460, bug 32033)").

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>