[PATCH v4 5/5] nptl: add pthread_attr_{get,set}shadowstacksize

Yury Khrustalev yury.khrustalev@arm.com
Fri Nov 7 09:35:09 GMT 2025


With the support of shadow stack, Glibc starts to have tools to manage
shadow stack allocation. Some control over this may be exposed as API.

This patch adds new pthread_attr...() functions that allow to set and
get shadow stack size using pthread attributes. This size is intended
to be used when creating a new thread on targets that support shadow
stacks.

Currently, the implementation is added only for the aarch64 targets,
however these functions are available on all targets that support POSIX
threads attributes. On targets that don't support shadow stack or don't
allocate it on the userspace side, the default shadow stack size is 0.

Supporting targets will provide THREAD_SHADOW_STACK_SIZE(size) macro
that should return default shadow stack size based on the current stack
size for a new thread.

To allocate shadow stack on the userspace side, a target should provide
the THREAD_ALLOC_SHADOW_STACK(pd, shadow_stack_size) macro which will
have target-dependent implementations.
---
 nptl/Makefile                                 |  3 +
 nptl/Versions                                 |  2 +
 nptl/pthread_attr_getshadowstacksize.c        | 44 ++++++++++
 nptl/pthread_attr_setshadowstacksize.c        | 43 ++++++++++
 nptl/pthread_create.c                         |  7 +-
 nptl/tst-pthread-attr-shadow-stack.c          | 54 ++++++++++++
 sysdeps/aarch64/libc-shadow-stack.h           | 11 ++-
 sysdeps/generic/libc-shadow-stack.h           |  5 +-
 sysdeps/nptl/internaltypes.h                  |  3 +
 sysdeps/nptl/pthread.h                        | 11 +++
 sysdeps/nptl/pthreadP.h                       | 16 ++++
 sysdeps/unix/sysv/linux/aarch64/Makefile      |  4 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist  |  2 +
 sysdeps/unix/sysv/linux/aarch64/makecontext.c |  3 +-
 .../sysv/linux/aarch64/tst-gcs-pthread-attr.c | 85 +++++++++++++++++++
 sysdeps/unix/sysv/linux/alpha/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/csky/libc.abilist     |  2 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist     |  2 +
 sysdeps/unix/sysv/linux/i386/libc.abilist     |  2 +
 .../sysv/linux/loongarch/lp64/libc.abilist    |  2 +
 .../sysv/linux/m68k/coldfire/libc.abilist     |  2 +
 .../unix/sysv/linux/m68k/m680x0/libc.abilist  |  2 +
 .../sysv/linux/microblaze/be/libc.abilist     |  2 +
 .../sysv/linux/microblaze/le/libc.abilist     |  2 +
 .../sysv/linux/mips/mips32/fpu/libc.abilist   |  2 +
 .../sysv/linux/mips/mips32/nofpu/libc.abilist |  2 +
 .../sysv/linux/mips/mips64/n32/libc.abilist   |  2 +
 .../sysv/linux/mips/mips64/n64/libc.abilist   |  2 +
 sysdeps/unix/sysv/linux/or1k/libc.abilist     |  2 +
 .../linux/powerpc/powerpc32/fpu/libc.abilist  |  2 +
 .../powerpc/powerpc32/nofpu/libc.abilist      |  2 +
 .../linux/powerpc/powerpc64/be/libc.abilist   |  2 +
 .../linux/powerpc/powerpc64/le/libc.abilist   |  2 +
 .../unix/sysv/linux/riscv/rv32/libc.abilist   |  2 +
 .../unix/sysv/linux/riscv/rv64/libc.abilist   |  2 +
 .../unix/sysv/linux/s390/s390-32/libc.abilist |  2 +
 .../unix/sysv/linux/s390/s390-64/libc.abilist |  2 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist    |  2 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist    |  2 +
 .../sysv/linux/sparc/sparc32/libc.abilist     |  2 +
 .../sysv/linux/sparc/sparc64/libc.abilist     |  2 +
 .../unix/sysv/linux/x86_64/64/libc.abilist    |  2 +
 .../unix/sysv/linux/x86_64/x32/libc.abilist   |  2 +
 45 files changed, 346 insertions(+), 7 deletions(-)
 create mode 100644 nptl/pthread_attr_getshadowstacksize.c
 create mode 100644 nptl/pthread_attr_setshadowstacksize.c
 create mode 100644 nptl/tst-pthread-attr-shadow-stack.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/tst-gcs-pthread-attr.c

diff --git a/nptl/Makefile b/nptl/Makefile
index 881b9f98cc..51fab5ab6a 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -73,6 +73,7 @@ routines = \
   pthread_attr_getschedparam \
   pthread_attr_getschedpolicy \
   pthread_attr_getscope \
+  pthread_attr_getshadowstacksize \
   pthread_attr_getsigmask \
   pthread_attr_getstack \
   pthread_attr_getstackaddr \
@@ -85,6 +86,7 @@ routines = \
   pthread_attr_setschedparam \
   pthread_attr_setschedpolicy \
   pthread_attr_setscope \
+  pthread_attr_setshadowstacksize \
   pthread_attr_setsigmask \
   pthread_attr_setsigmask_internal \
   pthread_attr_setstack \
@@ -316,6 +318,7 @@ tests = \
   tst-pthread-affinity-inheritance \
   tst-pthread-attr-affinity \
   tst-pthread-attr-affinity-fail \
+  tst-pthread-attr-shadow-stack \
   tst-pthread-attr-sigmask \
   tst-pthread-defaultattr-free \
   tst-pthread-gdb-attach \
diff --git a/nptl/Versions b/nptl/Versions
index b813b675b9..f59988059e 100644
--- a/nptl/Versions
+++ b/nptl/Versions
@@ -382,6 +382,8 @@ libc {
     pthread_gettid_np;
   }
   GLIBC_2.43 {
+    pthread_attr_getshadowstacksize;
+    pthread_attr_setshadowstacksize;
   }
   GLIBC_PRIVATE {
     __libc_alloca_cutoff;
diff --git a/nptl/pthread_attr_getshadowstacksize.c b/nptl/pthread_attr_getshadowstacksize.c
new file mode 100644
index 0000000000..c21cca1792
--- /dev/null
+++ b/nptl/pthread_attr_getshadowstacksize.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include "pthreadP.h"
+#include <shlib-compat.h>
+#include <libc-shadow-stack.h>
+
+extern int __pthread_attr_getshadowstacksize (const pthread_attr_t *attr,
+					      size_t *size)
+{
+  struct pthread_attr *iattr;
+  iattr = (struct pthread_attr *) attr;
+  if (iattr->extension != NULL)
+    *size = iattr->extension->shadow_stack_size;
+  else
+    {
+      /* If shadow stack size has not been set yet, return the
+         default value based on the current stack size.  */
+      size_t stacksize;
+      int ret = __pthread_attr_getstacksize (attr, &stacksize);
+      if (ret)
+        return ret;
+      *size = THREAD_SHADOW_STACK_SIZE (stacksize);
+    }
+  return 0;
+}
+versioned_symbol (libc, __pthread_attr_getshadowstacksize,
+		  pthread_attr_getshadowstacksize, GLIBC_2_43);
diff --git a/nptl/pthread_attr_setshadowstacksize.c b/nptl/pthread_attr_setshadowstacksize.c
new file mode 100644
index 0000000000..cd27a3fe94
--- /dev/null
+++ b/nptl/pthread_attr_setshadowstacksize.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stddef.h>
+#include "pthreadP.h"
+#include <shlib-compat.h>
+
+int __pthread_attr_setshadowstacksize (pthread_attr_t *attr, size_t size)
+{
+  struct pthread_attr *iattr;
+  iattr = (struct pthread_attr *) attr;
+
+  /* Catch invalid sizes.  */
+  int ret = check_shadow_stacksize_attr (size);
+  if (ret)
+    return ret;
+
+  if (iattr->extension == NULL)
+    {
+      ret = __pthread_attr_extension (iattr);
+      if (ret != 0)
+        return ret;
+    }
+  iattr->extension->shadow_stack_size = size;
+  return 0;
+}
+versioned_symbol (libc, __pthread_attr_setshadowstacksize,
+		  pthread_attr_setshadowstacksize, GLIBC_2_43);
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index aec2b717b5..f004010111 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -731,7 +731,12 @@ __pthread_create_2_1 (pthread_t *newthread, const pthread_attr_t *attr,
   pd->schedparam = self->schedparam;
 
   /* Set up a shadow stack.  */
-  err = THREAD_ALLOC_SHADOW_STACK (pd, stacksize);
+  size_t __attribute__ ((unused)) shadow_stack_size;
+  if (iattr->extension != NULL)
+    shadow_stack_size = iattr->extension->shadow_stack_size;
+  else
+    shadow_stack_size = THREAD_SHADOW_STACK_SIZE (stacksize);
+  err = THREAD_ALLOC_SHADOW_STACK (pd, shadow_stack_size);
   if (__glibc_unlikely (err != 0))
     {
       __nptl_deallocate_stack (pd);
diff --git a/nptl/tst-pthread-attr-shadow-stack.c b/nptl/tst-pthread-attr-shadow-stack.c
new file mode 100644
index 0000000000..8835e343fd
--- /dev/null
+++ b/nptl/tst-pthread-attr-shadow-stack.c
@@ -0,0 +1,54 @@
+/* Check pthread_attr_{s,g}etshadowstacksize.
+   Copyright (C) 2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <errno.h>
+#include <pthread.h>
+#include <support/check.h>
+#include <support/xthread.h>
+
+#define NEW_SH_STACK_SIZE 0x10000
+
+static int
+do_test (void)
+{
+  pthread_attr_t attr;
+  xpthread_attr_init (&attr);
+
+  size_t shadow_stack_size = 1;
+  TEST_VERIFY (!pthread_attr_getshadowstacksize (&attr, &shadow_stack_size));
+  TEST_VERIFY (shadow_stack_size != 1);
+  printf ("default shadow stack size: %zu\n", shadow_stack_size);
+
+  /* Try setting correct value. */
+  shadow_stack_size = NEW_SH_STACK_SIZE;
+  TEST_VERIFY (!pthread_attr_setshadowstacksize (&attr, shadow_stack_size));
+  TEST_VERIFY (!pthread_attr_getshadowstacksize (&attr, &shadow_stack_size));
+  TEST_VERIFY (shadow_stack_size == NEW_SH_STACK_SIZE);
+
+  /* Try setting incorrect value: expect error.  */
+  shadow_stack_size = 5;
+  TEST_VERIFY (pthread_attr_setshadowstacksize (&attr, shadow_stack_size) == EINVAL);
+  TEST_VERIFY (!pthread_attr_getshadowstacksize (&attr, &shadow_stack_size));
+  TEST_VERIFY (shadow_stack_size == NEW_SH_STACK_SIZE);
+
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/aarch64/libc-shadow-stack.h b/sysdeps/aarch64/libc-shadow-stack.h
index b8aac4b4d6..a6fdca812f 100644
--- a/sysdeps/aarch64/libc-shadow-stack.h
+++ b/sysdeps/aarch64/libc-shadow-stack.h
@@ -20,6 +20,8 @@
 #define _AARCH64_LIBC_SHADOW_STACK_H 1
 
 #include <stddef.h>
+#include <clone_internal.h>
+
 #include "aarch64-gcs.h"
 
 #define sizeof_field(TYPE, MEMBER) sizeof ((((TYPE *)0)->MEMBER))
@@ -28,9 +30,11 @@
 
 #ifdef HAVE_CLONE3_WRAPPER
 
-#define THREAD_ALLOC_SHADOW_STACK(pd, stacksize) \
-  thread_alloc_shadow_stack (pd, stacksize)
+#define THREAD_ALLOC_SHADOW_STACK(pd, shadow_stack_size) \
+  thread_alloc_shadow_stack (pd, shadow_stack_size)
 
+#define THREAD_SHADOW_STACK_SIZE(stack_size) \
+  ((stack_size / 2 + GCS_ALTSTACK_RESERVE) & -8UL)
 
 /* Support for shadow stack token in clone3 args:
      0 - not checked,
@@ -68,7 +72,7 @@ __clone3_supports_shadow_stack (void)
 }
 
 static inline int
-thread_alloc_shadow_stack (struct pthread *pd, size_t stacksize)
+thread_alloc_shadow_stack (struct pthread *pd, size_t shadow_stack_size)
 {
   if (!has_gcs ())
     return 0;
@@ -81,7 +85,6 @@ thread_alloc_shadow_stack (struct pthread *pd, size_t stacksize)
     }
   if (atomic_load_relaxed (&clone3_has_shadow_stack) == clone3_sh_stack_off)
     return 0;
-  size_t shadow_stack_size = (stacksize / 2 + GCS_ALTSTACK_RESERVE) & -8UL;
   struct gcs_record gcs;
   if (__alloc_gcs (shadow_stack_size, &gcs) != NULL)
     {
diff --git a/sysdeps/generic/libc-shadow-stack.h b/sysdeps/generic/libc-shadow-stack.h
index 09f8ca5175..0fc442725a 100644
--- a/sysdeps/generic/libc-shadow-stack.h
+++ b/sysdeps/generic/libc-shadow-stack.h
@@ -20,6 +20,9 @@
 #define _GENERIC_LIBC_SHADOW_STACK_H 1
 
 /* Allocate shadow stack if supported, returns an error code.  */
-#define THREAD_ALLOC_SHADOW_STACK(pd, stacksize) 0
+#define THREAD_ALLOC_SHADOW_STACK(pd, shadow_stack_size) 0
+
+/* Default shadow stack size based on the stack size.  */
+#define THREAD_SHADOW_STACK_SIZE(stack_size) 0
 
 #endif
diff --git a/sysdeps/nptl/internaltypes.h b/sysdeps/nptl/internaltypes.h
index efda6ea060..bccc402153 100644
--- a/sysdeps/nptl/internaltypes.h
+++ b/sysdeps/nptl/internaltypes.h
@@ -68,6 +68,9 @@ struct pthread_attr_extension
 
   sigset_t sigmask;
   bool sigmask_set;
+
+  /* Shadow stack handling.  */
+  size_t shadow_stack_size;
 };
 
 /* Mutex attribute data structure.  */
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index 92957a620d..0285440a14 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -388,6 +388,17 @@ extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
 				  size_t __stacksize) __THROW __nonnull ((1));
 #endif
 
+/* Return the currently used shadow stack size.  */
+extern int pthread_attr_getshadowstacksize (const pthread_attr_t *__restrict
+					    __attr, size_t *__restrict __size)
+     __THROW __nonnull ((1, 2));
+
+/* Set new shadow stack size to be used for Glibc-allocated shadow stacks
+   for new threads on platforms that support shadow stacks.  */
+extern int pthread_attr_setshadowstacksize (pthread_attr_t *__attr,
+					    size_t __size)
+     __THROW __nonnull ((1));
+
 #ifdef __USE_GNU
 /* Thread created with attribute ATTR will be limited to run only on
    the processors represented in CPUSET.  */
diff --git a/sysdeps/nptl/pthreadP.h b/sysdeps/nptl/pthreadP.h
index 3c9a14c3d6..651b93bf33 100644
--- a/sysdeps/nptl/pthreadP.h
+++ b/sysdeps/nptl/pthreadP.h
@@ -390,6 +390,11 @@ extern int __pthread_attr_getstack (const pthread_attr_t *__restrict __attr,
 				    size_t *__restrict __stacksize);
 extern int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
 				    size_t __stacksize);
+extern int __pthread_attr_getshadowstacksize (const pthread_attr_t *__restrict
+					      __attr,
+					      size_t *__restrict __size);
+extern int __pthread_attr_setshadowstacksize (pthread_attr_t *__attr,
+					      size_t __size);
 int __pthread_attr_setaffinity_np (pthread_attr_t *, size_t, const cpu_set_t *);
 libc_hidden_proto (__pthread_attr_setaffinity_np)
 extern __typeof (pthread_getattr_default_np) __pthread_getattr_default_np;
@@ -710,6 +715,17 @@ check_stacksize_attr (size_t st)
   return EINVAL;
 }
 
+/* Returns 0 if SIZE is a valid shadow stack size for a thread stack and
+   EINVAL otherwise.  */
+static inline int
+check_shadow_stacksize_attr (size_t size)
+{
+  if (size >= PTHREAD_STACK_MIN / 2)
+    return 0;
+
+  return EINVAL;
+}
+
 #define ASSERT_TYPE_SIZE(type, size) 					\
   _Static_assert (sizeof (type) == size,				\
 		  "sizeof (" #type ") != " #size)
diff --git a/sysdeps/unix/sysv/linux/aarch64/Makefile b/sysdeps/unix/sysv/linux/aarch64/Makefile
index 38cc7f32a7..70dde6af76 100644
--- a/sysdeps/unix/sysv/linux/aarch64/Makefile
+++ b/sysdeps/unix/sysv/linux/aarch64/Makefile
@@ -53,6 +53,7 @@ tests += \
   tst-gcs-clone3 \
   tst-gcs-clone3-cancel \
   tst-gcs-clone3-nomem \
+  tst-gcs-pthread-attr \
   # tests
 
 tests-static += \
@@ -63,6 +64,7 @@ tests-internal += \
   tst-gcs-clone3 \
   tst-gcs-clone3-cancel \
   tst-gcs-clone3-nomem \
+  tst-gcs-pthread-attr \
   # tests-internal
 
 define run-gcs-abort-test
@@ -92,6 +94,7 @@ LDFLAGS-tst-gcs-override-static += -Wl,-z,gcs=never
 LDFLAGS-tst-gcs-clone3 += -Wl,-z gcs=always
 LDFLAGS-tst-gcs-clone3-cancel += -Wl,-z gcs=always
 LDFLAGS-tst-gcs-clone3-nomem += -Wl,-z gcs=always
+LDFLAGS-tst-gcs-pthread-attr += -Wl,-z gcs=always
 
 tst-gcs-disabled-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=0
 tst-gcs-enforced-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1
@@ -110,6 +113,7 @@ tst-gcs-override-static-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=3
 tst-gcs-clone3-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1
 tst-gcs-clone3-cancel-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1
 tst-gcs-clone3-nomem-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1
+tst-gcs-pthread-attr-ENV = GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1
 
 # force one of the dependencies to be unmarked
 LDFLAGS-tst-gcs-mod2.so += -Wl,-z,gcs=never
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index ecb1be5bb4..21333f20ad 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2770,4 +2770,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/aarch64/makecontext.c b/sysdeps/unix/sysv/linux/aarch64/makecontext.c
index c9bb407e57..0d1134d671 100644
--- a/sysdeps/unix/sysv/linux/aarch64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/aarch64/makecontext.c
@@ -24,6 +24,7 @@
 #include <sys/mman.h>
 
 #include "aarch64-gcs.h"
+#include "libc-shadow-stack.h"
 
 #define GCS_MAGIC 0x47435300
 
@@ -36,7 +37,7 @@ static struct _aarch64_ctx *extension (void *p)
 static void *
 alloc_makecontext_gcs (size_t stack_size)
 {
-  size_t shadow_stack_size = (stack_size / 2 + GCS_ALTSTACK_RESERVE) & -8UL;
+  size_t shadow_stack_size = THREAD_SHADOW_STACK_SIZE (stack_size);
   void *gcsp = __alloc_gcs (shadow_stack_size, NULL);
   if (gcsp == NULL)
     /* ENOSYS, bad size or OOM.  */
diff --git a/sysdeps/unix/sysv/linux/aarch64/tst-gcs-pthread-attr.c b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-pthread-attr.c
new file mode 100644
index 0000000000..de0d59f412
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/tst-gcs-pthread-attr.c
@@ -0,0 +1,85 @@
+/* AArch64 tests for pthread attributes for shadow stack.
+   Copyright (C) 2025 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include "tst-gcs-helper.h"
+
+#include <nptl/descr.h>
+#include <support/xthread.h>
+
+#define NEW_SH_STACK_SIZE 0x10000
+
+static void *
+fun (void *arg)
+{
+  pthread_t self = pthread_self ();
+  struct pthread *pd = (struct pthread *)self;
+  uint64_t base = (uint64_t)pd->shadow_stack_base;
+  size_t actual_size = pd->shadow_stack_size;
+
+  /* If clone3 does not support shadow stack, this pointer
+     will not be initialised and test should give the
+     UNSUPPORTED result. */
+  if (base == 0)
+    {
+      puts ("shadow stack was not allocated by Glibc");
+      exit (EXIT_UNSUPPORTED);
+    }
+  printf ("shadow stack base:         %016lx\n", base);
+  printf ("shadow stack actual size:  %016lx\n", actual_size);
+
+  TEST_COMPARE (actual_size, NEW_SH_STACK_SIZE);
+
+  return NULL;
+}
+
+static void
+run_thread_test (void)
+{
+  pthread_attr_t attr;
+  xpthread_attr_init (&attr);
+
+  size_t shadow_stack_size = NEW_SH_STACK_SIZE;
+  TEST_VERIFY (!pthread_attr_setshadowstacksize (&attr, shadow_stack_size));
+
+  pthread_t th = xpthread_create (&attr, fun, NULL);
+  xpthread_join (th);
+}
+
+static int
+do_test (void)
+{
+  /* Check if GCS could possible by enabled.  */
+  if (!(getauxval (AT_HWCAP) & HWCAP_GCS))
+    {
+      puts ("kernel or CPU does not support GCS");
+      return EXIT_UNSUPPORTED;
+    }
+  /* Check that GCS is enabled.  */
+  bool gcs_enabled = __check_gcs_status ();
+  if (gcs_enabled)
+    puts ("GCS enabled");
+  else
+    puts ("GCS not enabled");
+  TEST_VERIFY (gcs_enabled);
+
+  run_thread_test ();
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 55c22da87f..86d7ae8cce 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3117,6 +3117,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 1ac00b8303..e4b179f939 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2823,6 +2823,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index cf92ab4ada..05714cb8d8 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2820,6 +2820,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 5d00604da5..2e098c63a5 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2807,4 +2807,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index 4011dc5cc0..1c33b69624 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2844,6 +2844,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 3757e41e6f..8f1df527b0 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -3027,6 +3027,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
index 8bbb950386..5fab3c02c9 100644
--- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
@@ -2291,4 +2291,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 74b36e84b6..1344345299 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2803,6 +2803,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index b5cf2998c3..e5747970da 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2970,6 +2970,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 547e21eb66..20c60cd688 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2856,4 +2856,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index f98407da28..c3ceda3081 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2853,4 +2853,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 1e207c97c3..22012d7fd6 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2933,6 +2933,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index f947cbb8f5..d0195af819 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2931,6 +2931,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index d44b0c41c0..10181d29b5 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2939,6 +2939,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index bdcde50165..c63327982c 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2841,6 +2841,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
index f2117e1dcc..4743c5f963 100644
--- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
+++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
@@ -2281,4 +2281,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index 6e887bcca4..c9020f6c79 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3160,6 +3160,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 247cbc2c8d..c5b14ba870 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3205,6 +3205,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 70fe1f2de8..cacdd89008 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2914,6 +2914,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 8f82f6c648..f07a37a0de 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2990,4 +2990,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index 57b5790914..65c643dd28 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2534,4 +2534,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index faeaebc500..343c3ec57f 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2734,4 +2734,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 62a71df101..28743ad4b5 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3158,6 +3158,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index 01681666e8..21f3b0fefa 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2951,6 +2951,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index b93a621870..62474eac69 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2850,6 +2850,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index fb41f72160..2381f5d2c1 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2847,6 +2847,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index cbe10bb14c..ab2fbb59ea 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3181,6 +3181,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 480dc5e8cd..3118a4d741 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2817,6 +2817,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index e46f66efdf..a272cd77db 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2766,6 +2766,8 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index a6edf8778a..b2740584d9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2785,4 +2785,6 @@ GLIBC_2.42 ullabs F
 GLIBC_2.43 __memset_explicit_chk F
 GLIBC_2.43 memalignment F
 GLIBC_2.43 memset_explicit F
+GLIBC_2.43 pthread_attr_getshadowstacksize F
+GLIBC_2.43 pthread_attr_setshadowstacksize F
 GLIBC_2.43 umaxabs F
-- 
2.47.3



More information about the Libc-alpha mailing list