]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
6 months agohtl: move pthread_barrierattr_getpshared, pthread_barrierattr_setpshared into libc.
gfleury [Sun, 9 Feb 2025 20:01:04 +0000 (22:01 +0200)] 
htl: move pthread_barrierattr_getpshared, pthread_barrierattr_setpshared into libc.

Message-ID: <20250209200108.865599-5-gfleury@disroot.org>

6 months agohtl: move pthread_barrierattr_init into libc.
gfleury [Sun, 9 Feb 2025 20:01:03 +0000 (22:01 +0200)] 
htl: move pthread_barrierattr_init into libc.

Message-ID: <20250209200108.865599-4-gfleury@disroot.org>

6 months agohtl: move pthread_barrierattr_destroy into libc.
gfleury [Sun, 9 Feb 2025 20:01:02 +0000 (22:01 +0200)] 
htl: move pthread_barrierattr_destroy into libc.

Message-ID: <20250209200108.865599-3-gfleury@disroot.org>

6 months agohtl: move __pthread_default_barrierattr into libc.
gfleury [Sun, 9 Feb 2025 20:01:01 +0000 (22:01 +0200)] 
htl: move __pthread_default_barrierattr into libc.

Message-ID: <20250209200108.865599-2-gfleury@disroot.org>

6 months agomanual: Update signal descriptions
DJ Delorie [Fri, 17 Jan 2025 22:34:02 +0000 (17:34 -0500)] 
manual: Update signal descriptions

Based on auditing all the signals and source trees for Hurd and
Linux...

SIGSYS - This is not used for a bad system call (ENOSYS is used
for that).  This is used by SECCOMP and some cases where an invalid
sub-function was requested.

SIGSTKFLT - Note it used to be a coprocessor stack fault but is now
obsolete and available for general user use.

SIGLOST - Hurd only now; note that its original purpose as an NFS
lock lost signal is obsolete.

SIGPWR - Note this is for power lost *and* power restored, and is
more a user-mode signal than a kernel-generated signal.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
6 months agolibio: Replace __LP64__ with __WORDSIZE
Tulio Magno Quites Machado Filho [Thu, 30 Jan 2025 18:51:01 +0000 (15:51 -0300)] 
libio: Replace __LP64__ with __WORDSIZE

__LP64__ is a GCC extension and shouldn't be used in an installed
header.

Fixes: 596a61cf6b (libio: Start to return errors when flushing fwrite's buffer [BZ #29459], 2025-01-28)
Reported-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Arjun Shankar <arjun@redhat.com>
6 months agopowerpc64le: Also avoid IFUNC for __mempcpy
Florian Weimer [Sun, 2 Feb 2025 15:21:39 +0000 (16:21 +0100)] 
powerpc64le: Also avoid IFUNC for __mempcpy

Code used during early static startup in elf/dl-tls.c uses
__mempcpy.

Fixes commit cbd9fd236981717d3d4ee942986ea912e9707c32 ("Consolidate
TLS block allocation for static binaries with ld.so").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoelf: Build dl-tls.o with early startup symbol redirections
Florian Weimer [Sun, 2 Feb 2025 15:22:23 +0000 (16:22 +0100)] 
elf: Build dl-tls.o with early startup symbol redirections

This is required when building for powerpc64le POWER8 with GCC 8
at least.

Fixes commit cbd9fd236981717d3d4ee942986ea912e9707c32 ("Consolidate
TLS block allocation for static binaries with ld.so").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agomanual: make @manpageurl more specific to each output
DJ Delorie [Tue, 10 Dec 2024 21:57:21 +0000 (16:57 -0500)] 
manual: make @manpageurl more specific to each output

Tweak the @manpageurl macro to customize the output for
each of html, info, and pdf output.  HTML and PDF (at
least, these days) support clicking on the link title,
whereas info does not.  Add text to the intro section
explaining which man pages are normative and which
aren't.

6 months agomath: Fix tanf for some inputs (BZ 32630)
Adhemerval Zanella [Sun, 2 Feb 2025 19:57:49 +0000 (16:57 -0300)] 
math: Fix tanf for some inputs (BZ 32630)

The logic was copied wrong from CORE-MATH.

6 months agoelf: Use _dl_find_object instead of _dl_find_dso_for_object in dlopen
Florian Weimer [Sun, 2 Feb 2025 19:10:09 +0000 (20:10 +0100)] 
elf: Use _dl_find_object instead of _dl_find_dso_for_object in dlopen

The _dl_find_object function uses a binary search and is faster if
there are many objects.

6 months agoelf: Add fast path to dlopen for fully-opened maps
Florian Weimer [Sun, 2 Feb 2025 19:10:09 +0000 (20:10 +0100)] 
elf: Add fast path to dlopen for fully-opened maps

If the map is already fully open (has matching flags and its
own scope allocated), it is not necessary to unprotected memory
during dlopen.

6 months agoelf: Determine the caller link map in _dl_open
Florian Weimer [Sun, 2 Feb 2025 19:10:09 +0000 (20:10 +0100)] 
elf: Determine the caller link map in _dl_open

No functional change expected.

This is in preparation of adding a fast path to dlopen in case
no link map changes are required.

6 months agoelf: Merge __dl_libc_freemem into __rtld_libc_freeres
Florian Weimer [Sun, 2 Feb 2025 19:10:09 +0000 (20:10 +0100)] 
elf: Merge __dl_libc_freemem into __rtld_libc_freeres

The functions serve very similar purposes.  The advantage of
__rtld_libc_freeres is that it is located within ld.so, so it is
more natural to poke at link map internals there.

This slightly regresses cleanup capabilities for statically linked
binaries.  If that becomes a problem, we should start calling
__rtld_libc_freeres from __libc_freeres (perhaps after renaming it).

6 months agoelf: Add l_soname accessor function for DT_SONAME values
Florian Weimer [Sun, 2 Feb 2025 19:10:09 +0000 (20:10 +0100)] 
elf: Add l_soname accessor function for DT_SONAME values

It's not necessary to introduce temporaries because the compiler
is able to evaluate l_soname just once in constracts like:

  l_soname (l) != NULL && strcmp (l_soname (l), LIBC_SO) != 0

6 months agoelf: Split _dl_lookup_map, _dl_map_new_object from _dl_map_object
Florian Weimer [Sun, 2 Feb 2025 19:10:08 +0000 (20:10 +0100)] 
elf: Split _dl_lookup_map, _dl_map_new_object from _dl_map_object

So that they can eventually be called separately from dlopen.

6 months agohurd: Use the new __proc_reauthenticate_complete protocol
Sergey Bugaev [Sat, 1 Feb 2025 17:17:38 +0000 (18:17 +0100)] 
hurd: Use the new __proc_reauthenticate_complete protocol

6 months agoelf: Do not add a copy of _dl_find_object to libc.so
Florian Weimer [Sat, 1 Feb 2025 11:37:58 +0000 (12:37 +0100)] 
elf: Do not add a copy of _dl_find_object to libc.so

This reduces code size and dependencies on ld.so internals from
libc.so.

Fixes commit f4c142bb9fe6b02c0af8cfca8a920091e2dba44b
("arm: Use _dl_find_object on __gnu_Unwind_Find_exidx (BZ 31405)").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agohtl: move pthread_setcancelstate into libc.
gfleury [Sat, 1 Feb 2025 08:02:02 +0000 (10:02 +0200)] 
htl: move pthread_setcancelstate into libc.

sysdeps/pthread/sem_open.c: call pthread_setcancelstate directely
since forward declaration is gone on hurd too
Message-ID: <20250201080202.494671-1-gfleury@disroot.org>

6 months agomath: Fix sinhf for some inputs (BZ 32627)
Adhemerval Zanella [Fri, 31 Jan 2025 13:34:32 +0000 (10:34 -0300)] 
math: Fix sinhf for some inputs (BZ 32627)

The logic was copied wrong from CORE-MATH.

6 months agomath: Fix log10p1f internal table value (BZ 32626)
Adhemerval Zanella [Fri, 31 Jan 2025 13:27:39 +0000 (10:27 -0300)] 
math: Fix log10p1f internal table value (BZ 32626)

It was copied wrong from CORE-MATH.

6 months agomanual: Safety annotations for timespec_get and timespec_getres
Tulio Magno Quites Machado Filho [Tue, 28 Jan 2025 18:31:01 +0000 (15:31 -0300)] 
manual: Safety annotations for timespec_get and timespec_getres

Add preliminary annotations that are consistent with clock_gettime and
clock_getres.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
6 months agosh: Fix tst-guard1 build
Adhemerval Zanella [Fri, 31 Jan 2025 12:34:36 +0000 (09:34 -0300)] 
sh: Fix tst-guard1 build

The tests uses ARCH_MIN_GUARD_SIZE and the sysdep.h include is not
required.

6 months agomanual: Add links to POSIX Semaphores man-pages documentation
Arjun Shankar [Tue, 14 Jan 2025 01:52:10 +0000 (02:52 +0100)] 
manual: Add links to POSIX Semaphores man-pages documentation

The POSIX Semaphores functions are currently undocumented in our info
pages.  This commit adds links to the man-pages documentation for all
the `sem_*' functions (except `sem_clockwait') so that they refer to
some useful documentation instead of just being stubs.  `sem_clockwait'
isn't documented by man-pages but thankfully already has a small useful
blurb in our own docs.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agomanual: Consolidate POSIX Semaphores docs in Threads chapter
Arjun Shankar [Tue, 14 Jan 2025 01:52:09 +0000 (02:52 +0100)] 
manual: Consolidate POSIX Semaphores docs in Threads chapter

This commit moves the `sem_*' family of functions from the IPC chapter,
replacing them with a reference to their new location in the Threads
chapter.  `sem_clockwait' is also moved out of the Non-POSIX Extensions
subsection since it is now included in the standard since Issue 8:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/sem_clockwait.html

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agold.so: Decorate BSS mappings
Petr Malat [Tue, 28 Jan 2025 10:08:20 +0000 (11:08 +0100)] 
ld.so: Decorate BSS mappings

Decorate BSS mappings with [anon: glibc: .bss <file>], for example
[anon: glibc: .bss /lib/libc.so.6]. The string ".bss" is already used
by bionic so use the same, but add the filename as well. If the name
would be longer than what the kernel allows, drop the directory part
of the path.

Refactor glibc.mem.decorate_maps check to a separate function and use
it to avoid assembling a name, which would not be used later.

Signed-off-by: Petr Malat <oss@malat.biz>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agonptl: Add support for setup guard pages with MADV_GUARD_INSTALL
Adhemerval Zanella [Wed, 8 Jan 2025 18:16:48 +0000 (15:16 -0300)] 
nptl: Add support for setup guard pages with MADV_GUARD_INSTALL

Linux 6.13 (662df3e5c3766) added a lightweight way to define guard areas
through madvise syscall.  Instead of PROT_NONE the guard region through
mprotect, userland can madvise the same area with a special flag, and
the kernel ensures that accessing the area will trigger a SIGSEGV (as for
PROT_NONE mapping).

The madvise way has the advantage of less kernel memory consumption for
the process page-table (one less VMA per guard area), and slightly less
contention on kernel (also due to the fewer VMA areas being tracked).

The pthread_create allocates a new thread stack in two ways: if a guard
area is set (the default) it allocates the memory range required using
PROT_NONE and then mprotect the usable stack area. Otherwise, if a
guard page is not set it allocates the region with the required flags.

For the MADV_GUARD_INSTALL support, the stack area region is allocated
with required flags and then the guard region is installed.  If the
kernel does not support it, the usual way is used instead (and
MADV_GUARD_INSTALL is disabled for future stack creations).

The stack allocation strategy is recorded on the pthread struct, and it
is used in case the guard region needs to be resized.  To avoid needing
an extra field, the 'user_stack' is repurposed and renamed to 'stack_mode'.

This patch also adds a proper test for the pthread guard.

I checked on x86_64, aarch64, powerpc64le, and hppa with kernel 6.13.0-rc7.

Reviewed-by: DJ Delorie <dj@redhat.com>
6 months agonptl: Correct stack size attribute when stack grows up [BZ #32574]
John David Anglin [Wed, 29 Jan 2025 21:51:16 +0000 (16:51 -0500)] 
nptl: Correct stack size attribute when stack grows up [BZ #32574]

Set stack size attribute to the size of the mmap'd region only
when the size of the remaining stack space is less than the size
of the mmap'd region.

This was reversed.  As a result, the initial stack size was only
135168 bytes.  On architectures where the stack grows down, the
initial stack size is approximately 8384512 bytes with the default
rlimit settings.  The small main stack size on hppa broke
applications like ruby that check for stack overflows.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
6 months agomanual: Update compatibility note on flushing of line-oriented files
Florian Weimer [Wed, 29 Jan 2025 09:28:10 +0000 (10:28 +0100)] 
manual: Update compatibility note on flushing of line-oriented files

Operation systems which represent text files in a line-oriented
fashion (and not as byte streams with a character sequence reserved
for line termination) logically cannot flush a buffer without
also creating a terminated line.

Update this portability note and move it to the Binary Streams
section.  Add another related compatibility concern, too.

6 months agohtl: move pthread_setcanceltype into libc.
gfleury [Fri, 3 Jan 2025 10:37:50 +0000 (12:37 +0200)] 
htl: move pthread_setcanceltype into libc.

Message-ID: <20250103103750.870897-7-gfleury@disroot.org>

6 months agohtl: move pthread_mutex_consistent, pthread_mutex_consistent_np into libc.
gfleury [Fri, 3 Jan 2025 10:37:49 +0000 (12:37 +0200)] 
htl: move pthread_mutex_consistent, pthread_mutex_consistent_np into libc.

Message-ID: <20250103103750.870897-6-gfleury@disroot.org>

6 months agohtl: move pthread_mutex_destroy into libc.
gfleury [Fri, 3 Jan 2025 10:37:48 +0000 (12:37 +0200)] 
htl: move pthread_mutex_destroy into libc.

Message-ID: <20250103103750.870897-5-gfleury@disroot.org>

6 months agohtl: move pthread_mutex_getprioceiling, pthread_mutex_setprioceiling into libc
gfleury [Fri, 3 Jan 2025 10:37:47 +0000 (12:37 +0200)] 
htl: move pthread_mutex_getprioceiling, pthread_mutex_setprioceiling into libc

Message-ID: <20250103103750.870897-4-gfleury@disroot.org>

6 months agohtl: move pthread_mutex_{lock, unlock, trylock, timedlock, clocklock}
gfleury [Fri, 3 Jan 2025 10:37:46 +0000 (12:37 +0200)] 
htl: move pthread_mutex_{lock, unlock, trylock, timedlock, clocklock}

I haven't exposed _pthread_mutex_lock,  _pthread_mutex_trylock and
_pthread_mutex_unlock in GLIBC_PRIVATE since there aren't used in any
code in libpthread
Message-ID: <20250103103750.870897-3-gfleury@disroot.org>

6 months agohtl: move pthread_mutex_init into libc.
gfleury [Fri, 3 Jan 2025 10:37:45 +0000 (12:37 +0200)] 
htl: move pthread_mutex_init into libc.

Message-ID: <20250103103750.870897-2-gfleury@disroot.org>

6 months agohtl: remove leftover for pthread_mutexattr_settype
gfleury [Tue, 28 Jan 2025 23:33:04 +0000 (00:33 +0100)] 
htl: remove leftover for pthread_mutexattr_settype

from b386295727d35a83aa3d4750e198cbf8040c9a23

6 months agoAdd test of input file flushing / offset issues
Joseph Myers [Tue, 28 Jan 2025 23:39:12 +0000 (23:39 +0000)] 
Add test of input file flushing / offset issues

Having fixed several bugs relating to flushing of FILE* streams (with
fflush and other operations) and their offsets (both the file position
indicator in the FILE*, and the offset in the underlying open file
description), especially after ungetc but not limited to that case,
add a test that more systematically covers different combinations of
cases for such issues, with 57220 separate scenarios tested (which
include examples of all the five separate fixed bugs), all of which
pass given the five previous bug fixes.

Tested for x86_64.

6 months agoFix fflush handling for mmap files after ungetc (bug 32535)
Joseph Myers [Tue, 28 Jan 2025 23:20:08 +0000 (23:20 +0000)] 
Fix fflush handling for mmap files after ungetc (bug 32535)

As discussed in bug 32535, fflush fails on files opened for reading
using mmap after ungetc.  Fix the logic to handle this case and still
compute the file offset correctly.

Tested for x86_64.

6 months agoFix fseek handling for mmap files after ungetc or fflush (bug 32529)
Joseph Myers [Tue, 28 Jan 2025 22:35:21 +0000 (22:35 +0000)] 
Fix fseek handling for mmap files after ungetc or fflush (bug 32529)

As discussed in bug 32529, fseek fails on files opened for reading
using mmap after ungetc.  The implementation of fseek for such files
has an offset computation that's also incorrect after fflush.  A
combined fix addresses both problems (with tests for both included as
well) and it seems reasonable to consider them a single bug.

Tested for x86_64.

6 months agoMake fflush (NULL) flush input files (bug 32369)
Joseph Myers [Tue, 28 Jan 2025 21:53:49 +0000 (21:53 +0000)] 
Make fflush (NULL) flush input files (bug 32369)

As discussed in bug 32369 and required by POSIX, the POSIX feature
fflush (NULL) should flush input files, not just output files.  The
POSIX requirement is that "fflush() shall perform this flushing action
on all streams for which the behavior is defined above", and the
definition for input files is for "a stream open for reading with an
underlying file description, if the file is not already at EOF, and
the file is one capable of seeking".

Implement this requirement in glibc.  (The underlying flushing
implementation is what deals with avoiding errors for seeking on an
unseekable file.)

Tested for x86_64.

6 months agoMake fclose seek input file to right offset (bug 12724)
Joseph Myers [Tue, 28 Jan 2025 20:22:56 +0000 (20:22 +0000)] 
Make fclose seek input file to right offset (bug 12724)

As discussed in bug 12724 and required by POSIX, before an input file
(based on an underlying seekable file descriptor) is closed, fclose is
sometimes required to seek that file descriptor to the correct offset,
so that any other file descriptors sharing the underlying open file
description are left at that offset (as a motivating example, a script
could call a sequence of commands each of which processes some data
from (seekable) stdin using stdio; fclose needs to do this so that
each successive command can read exactly the data not handled by
previous commands), but glibc fails to do this.

The precise POSIX wording has changed a few times; in the 2024 edition
it's "If the file is not already at EOF, and the file is one capable
of seeking, the file offset of the underlying open file description
shall be set to the file position of the stream if the stream is the
active handle to the underlying file description.".

Add appropriate logic to _IO_new_file_close_it to handle this case.  I
haven't made any attempt to test or change things in this area for the
"old" functions.

Note that there was a previous attempt to fix bug 12724, reverted in
commit eb6cbd249f4465b01f428057bf6ab61f5f0c07e3.  The fix version here
addresses the original test in that bug report without breaking the
one given in a subsequent comment in that bug report (which works with
glibc before the patch, but maybe was broken by the original fix that
was reverted).

The logic here tries to take care not to seek the file, even to its
newly computed current offset, if at EOF / possibly not the active
handle; even seeking to the current offset would be problematic
because of a potential race (fclose computes the current offset,
another thread or process with the active handle does its own seek,
fclose does a seek (not permitted by POSIX in this case) that loses
the effect of the seek on the active handle in another thread or
process).  There are tests included for various cases of being or not
being the active handle, though there aren't tests for the potential
race condition.

Tested for x86_64.

6 months agoFix fflush after ungetc on input file (bug 5994)
Joseph Myers [Tue, 28 Jan 2025 19:38:27 +0000 (19:38 +0000)] 
Fix fflush after ungetc on input file (bug 5994)

As discussed in bug 5994 (plus duplicates), POSIX requires fflush
after ungetc to discard pushed-back characters but preserve the file
position indicator.  For this purpose, each ungetc decrements the file
position indicator by 1; it is unspecified after ungetc at the start
of the file, and after ungetwc, so no special handling is needed for
either of those cases.

This is fixed with appropriate logic in _IO_new_file_sync.  I haven't
made any attempt to test or change things in this area for the "old"
functions; the case of files using mmap is addressed in a subsequent
patch (and there seem to be no problems in this area with files opened
with fmemopen).

Tested for x86_64.

6 months agolibio: Add a new fwrite test that evaluates partial writes
Tulio Magno Quites Machado Filho [Tue, 28 Jan 2025 18:37:44 +0000 (15:37 -0300)] 
libio: Add a new fwrite test that evaluates partial writes

Test if the file-position is correctly updated when fwrite tries to
flush its internal cache but is not able to completely write all items.

Reviewed-by: DJ Delorie <dj@redhat.com>
6 months agolibio: Start to return errors when flushing fwrite's buffer [BZ #29459]
Tulio Magno Quites Machado Filho [Tue, 28 Jan 2025 18:37:44 +0000 (15:37 -0300)] 
libio: Start to return errors when flushing fwrite's buffer [BZ #29459]

When an error happens, fwrite is expected to return a value that is less
than nmemb.  If this error happens while flushing its internal buffer,
fwrite is in a complex scenario: all the data might have been written to
the buffer, indicating a successful copy, but the buffer is expected to
be flushed and it was not.

POSIX.1-2024 states the following about errors on fwrite:

    If an error occurs, the resulting value of the file-position indicator
    for the stream is unspecified.

    The fwrite() function shall return the number of elements successfully
    written, which may be less than nitems if a write error is encountered.

With that in mind, this commit modifies _IO_new_file_write in order to
return the total number of bytes written via the file pointer.  It also
modifies fwrite in order to use the new information and return the
correct number of bytes written even when sputn returns EOF.

Add 2 tests:

1. tst-fwrite-bz29459: This test is based on the reproducer attached to
   bug 29459.  In order to work, it requires to pipe stdout to another
   process making it hard to reuse test-driver.c.  This code is more
   specific to the issue reported.
2. tst-fwrite-pipe: Recreates the issue by creating a pipe that is shared
   with a child process.  Reuses test-driver.c.  Evaluates a more generic
   scenario.

Co-authored-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
6 months agoAdd new tests for fopen
Martin Coufal [Thu, 23 Jan 2025 12:04:06 +0000 (13:04 +0100)] 
Add new tests for fopen

Adding some basic tests for fopen, testing different modes, stream
positioning and concurrent read/write operation on files.
Reviewed-by: DJ Delorie <dj@redhat.com>
6 months agoIncrease version to 2.41.9000, add new section to NEWS glibc-2.41.9000
Andreas K. Hüttel [Tue, 28 Jan 2025 17:42:35 +0000 (18:42 +0100)] 
Increase version to 2.41.9000, add new section to NEWS

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoCreate ChangeLog.old/ChangeLog.30 glibc-2.41
Andreas K. Hüttel [Tue, 28 Jan 2025 17:31:33 +0000 (18:31 +0100)] 
Create ChangeLog.old/ChangeLog.30

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoBump version to 2.41
Andreas K. Hüttel [Tue, 28 Jan 2025 17:25:13 +0000 (18:25 +0100)] 
Bump version to 2.41

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agopo: update translations (final, only timestamp and line number changes)
Andreas K. Hüttel [Tue, 28 Jan 2025 12:47:28 +0000 (13:47 +0100)] 
po: update translations (final, only timestamp and line number changes)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agolibc.pot: regenerate (only line number changes)
Andreas K. Hüttel [Tue, 28 Jan 2025 11:36:07 +0000 (12:36 +0100)] 
libc.pot: regenerate (only line number changes)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoINSTALL: update last tested version numbers
Andreas K. Hüttel [Tue, 28 Jan 2025 11:31:08 +0000 (12:31 +0100)] 
INSTALL: update last tested version numbers

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agocontrib.texi: minor improvements
Andreas K. Hüttel [Mon, 27 Jan 2025 15:30:54 +0000 (16:30 +0100)] 
contrib.texi: minor improvements

Mention CORE-MATH developers by name
Fix accent

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoNEWS: Add some more news from the 2.41 cycle
Andreas K. Hüttel [Sun, 26 Jan 2025 21:45:27 +0000 (22:45 +0100)] 
NEWS: Add some more news from the 2.41 cycle

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agocontrib.texi: Update from 2.40..2.41 commit log
Andreas K. Hüttel [Mon, 27 Jan 2025 00:06:16 +0000 (01:06 +0100)] 
contrib.texi: Update from 2.40..2.41 commit log

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoNEWS: Add reference to (single) advisory
Andreas K. Hüttel [Sun, 26 Jan 2025 22:30:13 +0000 (23:30 +0100)] 
NEWS: Add reference to (single) advisory

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoNEWS: Add list of bugs fixed in 2.41
Andreas K. Hüttel [Sun, 26 Jan 2025 22:26:07 +0000 (23:26 +0100)] 
NEWS: Add list of bugs fixed in 2.41

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoNEWS: editorial changes (language, line breaks)
Andreas K. Hüttel [Sun, 26 Jan 2025 19:09:26 +0000 (20:09 +0100)] 
NEWS: editorial changes (language, line breaks)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agotestsuite: Make stdio-common/tst-printf-format-*-mem UNSUPPORTED if the mtrace output...
Xi Ruoyao [Sat, 25 Jan 2025 16:48:27 +0000 (00:48 +0800)] 
testsuite: Make stdio-common/tst-printf-format-*-mem UNSUPPORTED if the mtrace output does not exist

When gawk was not built with MPFR, there's no mtrace output and those
tests FAIL.  But we should make them UNSUPPORTED like other
tst-printf-format-* tests in the case.

Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Andreas K Hüttel <dilfridge@gentoo.org>
6 months agoelf: fix 'valgrind' typo in comment
Sam James [Sat, 25 Jan 2025 05:34:20 +0000 (05:34 +0000)] 
elf: fix 'valgrind' typo in comment

6 months agomalloc: cleanup casts in tst-calloc
Sam James [Mon, 13 Jan 2025 02:27:41 +0000 (02:27 +0000)] 
malloc: cleanup casts in tst-calloc

Followup to c3d1dac96bdd10250aa37bb367d5ef8334a093a1. As pointed out by
Maciej W. Rozycki, the casts are obviously useless now.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
6 months agostdlib: Test using setenv with updated environ [BZ #32588]
H.J. Lu [Fri, 24 Jan 2025 10:53:13 +0000 (18:53 +0800)] 
stdlib: Test using setenv with updated environ [BZ #32588]

Add a test for setenv with updated environ.  Verify that BZ #32588 is
fixed.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
6 months agoLICENSES: update CORE-MATH copyright
Aurelien Jarno [Wed, 22 Jan 2025 21:11:24 +0000 (22:11 +0100)] 
LICENSES: update CORE-MATH copyright

Many more files from the CORE-MATH have been added. Also update the
authors and copyright years.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoLICENSES: update location of getaddrinfo.c and getnameinfo.c
Aurelien Jarno [Wed, 22 Jan 2025 21:11:24 +0000 (22:11 +0100)] 
LICENSES: update location of getaddrinfo.c and getnameinfo.c

posix/getaddrinfo.c got moved into nss/getaddrinfo.c in commit
7f602256ab5b ("Move getaddrinfo from 'posix' into 'nss'")

inet/getnameinfo.c got moved into nss/getnameinfo.c in commit
2f1c 6652 d7b3 ("Move getnameinfo from 'inet' to 'nss'")

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoLICENSES: remove Intel License Agreement
Aurelien Jarno [Wed, 22 Jan 2025 21:11:24 +0000 (22:11 +0100)] 
LICENSES: remove Intel License Agreement

The corresponding files are gone with the IA64 removal in commit
460860f457e2 ("Remove ia64-linux-gnu").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agostdlib: Re-implement free (environ) compatibility kludge for setenv
Florian Weimer [Fri, 24 Jan 2025 09:40:28 +0000 (10:40 +0100)] 
stdlib: Re-implement free (environ) compatibility kludge for setenv

For the originally failing application (userhelper from usermode),
it is not actually necessary to call realloc on the environ
pointer.  Yes, there will be a memory leak because the application
assigns a heap-allocated pointer to environ that it never frees,
but this leak was always there: the old realloc-based setenv had
a hidden internal variable, last_environ, that was used in a similar
way to __environ_array_list.  The application is not impacted by
the leak anyway because the relevant operations do not happen in
a loop.

The change here just uses a separte heap allocation and points
environ to that.  This means that if an application calls
free (environ) and restores the environ pointer to the value
at process start, and does not modify the environment further,
nothing bad happens.

This change should not invalidate any previous testing that went into
the original getenv thread safety change, commit 7a61e7f557a97ab597d6
("stdlib: Make getenv thread-safe in more cases").

The new test cases are modeled in part on the env -i use case from
bug 32588 (with !DO_MALLOC && !DO_EARLY_SETENV), and the previous
stdlib/tst-setenv-malloc test.  The DO_MALLOC && !DO_EARLY_SETENV
case in the new test should approximate what userhelper from the
usermode package does.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 months agoRevert "stdlib: Support malloc-managed environ arrays for compatibility"
Florian Weimer [Fri, 24 Jan 2025 07:04:23 +0000 (08:04 +0100)] 
Revert "stdlib: Support malloc-managed environ arrays for compatibility"

This reverts commit b62759db04b8ed7f829c06f1d7c3b8fb70616493.

Reason for revert: Incompatible with “env -i” and coreutils (bug 32588).

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
6 months agostdlib: Support malloc-managed environ arrays for compatibility
Florian Weimer [Wed, 22 Jan 2025 12:48:56 +0000 (13:48 +0100)] 
stdlib: Support malloc-managed environ arrays for compatibility

Some applications set environ to a heap-allocated pointer, call
setenv (expecting it to call realloc), free environ, and then
restore the original environ pointer.  This breaks after
commit 7a61e7f557a97ab597d6fca5e2d1f13f65685c61 ("stdlib: Make
getenv thread-safe in more cases") because after the setenv call,
the environ pointer does not point to the start of a heap allocation.
Instead, setenv creates a separate allocation and changes environ
to point into that.  This means that the free call in the application
results in heap corruption.

The interim approach was more compatible with other libcs because
it does not assume that the incoming environ pointer is allocated
as if by malloc (if it was written by the application).  However,
it seems to be more important to stay compatible with previous
glibc version: assume the incoming pointer is heap allocated,
and preserve this property after setenv calls.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 months agopo: Incorporate translations
Andreas K. Hüttel [Wed, 22 Jan 2025 21:50:23 +0000 (22:50 +0100)] 
po: Incorporate translations

be ca cs da de el eo es fi fr gl hr hu ia id it ja ka ko lt nb nl pl pt ro ru rw sk sl sr sv tr uk vi zh_CN zh_TW

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
6 months agoUpdate advisory GLIBC-SA-2025-0001 (2.40)
Siddhesh Poyarekar [Wed, 22 Jan 2025 14:40:52 +0000 (09:40 -0500)] 
Update advisory GLIBC-SA-2025-0001 (2.40)

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
6 months agoAdd advisory text for CVE-2025-0395
Siddhesh Poyarekar [Tue, 21 Jan 2025 21:48:29 +0000 (16:48 -0500)] 
Add advisory text for CVE-2025-0395

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

6 months agoFix underallocation of abort_msg_s struct (CVE-2025-0395)
Siddhesh Poyarekar [Tue, 21 Jan 2025 21:11:06 +0000 (16:11 -0500)] 
Fix underallocation of abort_msg_s struct (CVE-2025-0395)

Include the space needed to store the length of the message itself, in
addition to the message string.  This resolves BZ #32582.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

6 months agoNEWS: Add note on Guarded Control Stack support
Yury Khrustalev [Tue, 21 Jan 2025 13:44:05 +0000 (13:44 +0000)] 
NEWS: Add note on Guarded Control Stack support

Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
6 months agoFix typo: _POSIX_REATIME_SIGNALS -> _POSIX_REALTIME_SIGNALS [BZ# 32515]
Paul Pluzhnikov [Mon, 20 Jan 2025 21:47:38 +0000 (21:47 +0000)] 
Fix typo: _POSIX_REATIME_SIGNALS -> _POSIX_REALTIME_SIGNALS [BZ# 32515]

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Add HWCAP_GCS
Yury Khrustalev [Tue, 21 Jan 2025 09:39:45 +0000 (09:39 +0000)] 
aarch64: Add HWCAP_GCS

Use upper 32 bits of HWCAP.

Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
6 months agonptl: Include <stdbool.h> in tst-skeleton-affinity-inheritance.c
Florian Weimer [Tue, 21 Jan 2025 09:36:58 +0000 (10:36 +0100)] 
nptl: Include <stdbool.h> in tst-skeleton-affinity-inheritance.c

The file uses the identifiers bool, false, true.

6 months agostdlib: Test for expected sequence of random numbers from rand
Florian Weimer [Mon, 20 Jan 2025 20:06:59 +0000 (21:06 +0100)] 
stdlib: Test for expected sequence of random numbers from rand

As the test comment explains, this test is not quite valid, but
preserving the exact sequences helps distributions to port to
newer glibc versions.  We can remove this test if we ever switch
to a different implementation.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
6 months agostdlib: Fix unintended change to the random_r implementation
Florian Weimer [Mon, 20 Jan 2025 20:06:43 +0000 (21:06 +0100)] 
stdlib: Fix unintended change to the random_r implementation

Commit d5bceac99d24af1131b90027dab267e437b65cd1 changed the sequence
of random numbers.  This was completely unintended.  The statistical
properties of the new sequences are unclear, so restore the old
behavior.

Fixes commit d5bceac99d24af1131b90027dab267e437b65cd1 ("stdlib:
random_r: fix unaligned access in initstate and initstate_r
[BZ #30584]").

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
6 months agoelf: Make tst-ro-dynamic-mod.map compatible with older binutils
Florian Weimer [Mon, 20 Jan 2025 19:35:10 +0000 (20:35 +0100)] 
elf: Make tst-ro-dynamic-mod.map compatible with older binutils

Older versions such as binutils 2.35.2 do not recognize
PT_GNU_PROPERTY.

Fixes commit d3f2b71ef1d146137a25dd1367d97a14fac341c6
("aarch64: Fix tests not compatible with targets supporting GCS").

6 months agoNEWS: Add the extensible rseq ABI to new features
Michael Jeanson [Tue, 14 Jan 2025 20:03:56 +0000 (15:03 -0500)] 
NEWS: Add the extensible rseq ABI to new features

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
6 months agoLinux: Do not check unused bytes after sched_getattr in tst-sched_setattr
Florian Weimer [Mon, 20 Jan 2025 08:57:09 +0000 (09:57 +0100)] 
Linux: Do not check unused bytes after sched_getattr in tst-sched_setattr

Linux 6.13 was released with a change that overwrites those bytes.
This means that the check_unused subtest fails.

Update the manual accordingly.

Tested-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoi386: Update ulps for *pi functions
Florian Weimer [Mon, 20 Jan 2025 10:33:58 +0000 (11:33 +0100)] 
i386: Update ulps for *pi functions

As seen with GCC 11.5 on an AMD Ryzen 9 7950X CPU, with an
-fpmath=sse, --disable-multi-arch build of glibc.

6 months agoaarch64: Fix tests not compatible with targets supporting GCS
Yury Khrustalev [Tue, 26 Nov 2024 11:38:30 +0000 (11:38 +0000)] 
aarch64: Fix tests not compatible with targets supporting GCS

 - Add GCS marking to some of the tests when target supports GCS
 - Fix tst-ro-dynamic-mod.map linker script to avoid removing
   GNU properties
 - Add header with macros for GNU properties

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoaarch64: Use __alloc_gcs in makecontext
Szabolcs Nagy [Wed, 28 Aug 2024 10:00:19 +0000 (11:00 +0100)] 
aarch64: Use __alloc_gcs in makecontext

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Add GCS user-space allocation logic
Szabolcs Nagy [Wed, 28 Aug 2024 10:21:19 +0000 (11:21 +0100)] 
aarch64: Add GCS user-space allocation logic

Allocate GCS based on the stack size, this can be used for coroutines
(makecontext) and thread creation (if the kernel allows user allocated
GCS).

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoaarch64: Process gnu properties in static exe
Szabolcs Nagy [Wed, 27 Dec 2023 17:17:11 +0000 (17:17 +0000)] 
aarch64: Process gnu properties in static exe

Unlike for BTI, the kernel does not process GCS properties so update
GL(dl_aarch64_gcs) before the GCS status is set.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Ignore GCS property of ld.so
Szabolcs Nagy [Wed, 10 Jan 2024 16:20:24 +0000 (16:20 +0000)] 
aarch64: Ignore GCS property of ld.so

check_gcs is called for each dependency of a DSO, but the GNU property
of the ld.so is not processed so ldso->l_mach.gcs may not be correct.
Just assume ld.so is GCS compatible independently of the ELF marking.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoaarch64: Handle GCS marking
Szabolcs Nagy [Thu, 21 Dec 2023 23:05:10 +0000 (23:05 +0000)] 
aarch64: Handle GCS marking

 - Handle GCS marking
 - Use l_searchlist.r_list for gcs (allows using the
   same function for static exe)

Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Use l_searchlist.r_list for bti
Szabolcs Nagy [Thu, 28 Dec 2023 18:31:32 +0000 (18:31 +0000)] 
aarch64: Use l_searchlist.r_list for bti

Allows using the same function for static exe.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoaarch64: Mark objects with GCS property note
Szabolcs Nagy [Fri, 22 Dec 2023 12:29:48 +0000 (12:29 +0000)] 
aarch64: Mark objects with GCS property note

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 months agoaarch64: Enable GCS in dynamic linked exe
Szabolcs Nagy [Fri, 14 Jul 2023 14:49:11 +0000 (15:49 +0100)] 
aarch64: Enable GCS in dynamic linked exe

Use the dynamic linker start code to enable GCS in the dynamic linked
case after _dl_start returns and before _dl_start_user which marks
the point after which user code may run.

Like in the static linked case this ensures that GCS is enabled on a
top level stack frame.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Enable GCS in static linked exe
Szabolcs Nagy [Thu, 13 Jul 2023 06:22:44 +0000 (07:22 +0100)] 
aarch64: Enable GCS in static linked exe

Use the ARCH_SETUP_TLS hook to enable GCS in the static linked case.
The system call must be inlined and then GCS is enabled on a top
level stack frame that does not return and has no exception handlers
above it.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Add glibc.cpu.aarch64_gcs tunable
Szabolcs Nagy [Mon, 17 Jul 2023 07:31:05 +0000 (08:31 +0100)] 
aarch64: Add glibc.cpu.aarch64_gcs tunable

This tunable controls Guarded Control Stack (GCS) for the process.

0 = disabled: do not enable GCS
1 = enforced: check markings and fail if any binary is not marked
2 = optional: check markings but keep GCS off if a binary is unmarked
3 = override: enable GCS, markings are ignored

By default it is 0, so GCS is disabled, value 1 will enable GCS.

The status is stored into GL(dl_aarch64_gcs) early and only applied
later, since enabling GCS is tricky: it must happen on a top level
stack frame. Using GL instead of GLRO because it may need updates
depending on loaded libraries that happen after readonly protection
is applied, however library marking based GCS setting is not yet
implemented.

Describe new tunable in the manual.

Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Add GCS support for makecontext
Szabolcs Nagy [Tue, 4 Apr 2023 09:42:21 +0000 (10:42 +0100)] 
aarch64: Add GCS support for makecontext

Changed the makecontext logic: previously the first setcontext jumped
straight to the user callback function and the return address is set
to __startcontext. This does not work when GCS is enabled as the
integrity of the return address is protected, so instead the context
is setup such that setcontext jumps to __startcontext which calls the
user callback (passed in x20).

The map_shadow_stack syscall is used to allocate a suitably sized GCS
(which includes some reserved area to account for altstack signal
handlers and otherwise supports maximum number of 16 byte aligned
stack frames on the given stack) however the GCS is never freed as
the lifetime of ucontext and related stack is user managed.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 months agoaarch64: Mark swapcontext with indirect_return
Szabolcs Nagy [Thu, 28 Dec 2023 15:53:38 +0000 (15:53 +0000)] 
aarch64: Mark swapcontext with indirect_return

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 months agoaarch64: Add GCS support for setcontext
Szabolcs Nagy [Fri, 24 Feb 2023 16:29:32 +0000 (16:29 +0000)] 
aarch64: Add GCS support for setcontext

Userspace ucontext needs to store GCSPR, it does not have to be
compatible with the kernel ucontext. For now we use the linux
struct gcs_context layout but only use the gcspr field from it.

Similar implementation to the longjmp code, supports switching GCS
if the target GCS is capped, and unwinding a continuous GCS to a
previous state.

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 months agoaarch64: Add GCS support to vfork
Szabolcs Nagy [Wed, 27 Dec 2023 18:36:10 +0000 (18:36 +0000)] 
aarch64: Add GCS support to vfork

Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 months agoaarch64: Add GCS support to longjmp
Szabolcs Nagy [Thu, 23 Feb 2023 08:54:04 +0000 (08:54 +0000)] 
aarch64: Add GCS support to longjmp

This implementations ensures that longjmp across different stacks
works: it scans for GCS cap token and switches GCS if necessary
then the target GCSPR is restored with a GCSPOPM loop once the
current GCSPR is on the same GCS.

This makes longjmp linear time in the number of jumped over stack
frames when GCS is enabled.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoaarch64: Define jmp_buf offset for GCS
Szabolcs Nagy [Fri, 25 Nov 2022 18:16:07 +0000 (18:16 +0000)] 
aarch64: Define jmp_buf offset for GCS

The target specific internal __longjmp is called with a __jmp_buf
argument which has its size exposed in the ABI. On aarch64 this has
no space left, so GCSPR cannot be restored in longjmp in the usual
way, which is needed for the Guarded Control Stack (GCS) extension.

setjmp is implemented via __sigsetjmp which has a jmp_buf argument
however it is also called with __pthread_unwind_buf_t argument cast
to jmp_buf (in cancellation cleanup code built with -fno-exception).
The two types, jmp_buf and __pthread_unwind_buf_t, have common bits
beyond the __jmp_buf field and there is unused space there which we
can use for saving GCSPR.

For this to work some bits of those two generic types have to be
reserved for target specific use and the generic code in glibc has
to ensure that __longjmp is always called with a __jmp_buf that is
embedded into one of those two types. Morally __longjmp should be
changed to take jmp_buf as argument, but that is an intrusive change
across targets.

Note: longjmp is never called with __pthread_unwind_buf_t from user
code, only the internal __libc_longjmp is called with that type and
thus the two types could have separate longjmp implementations on a
target. We don't rely on this now (but might in the future given that
cancellation unwind does not need to restore GCSPR).

Given the above this patch finds an unused slot for GCSPR. This
placement is not exposed in the ABI so it may change in the future.
This is also very target ABI specific so the generic types cannot
be easily changed to clearly mark the reserved fields.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoelf.h: Define GNU_PROPERTY_AARCH64_FEATURE_1_GCS
Szabolcs Nagy [Fri, 22 Dec 2023 09:47:33 +0000 (09:47 +0000)] 
elf.h: Define GNU_PROPERTY_AARCH64_FEATURE_1_GCS

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
6 months agoaarch64: Add asm helpers for GCS
Szabolcs Nagy [Wed, 22 Feb 2023 14:35:00 +0000 (14:35 +0000)] 
aarch64: Add asm helpers for GCS

The Guarded Control Stack instructions can be present even if the
hardware does not support the extension (runtime checked feature),
so the asm code should be backward compatible with old assemblers.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>