[v2] string: New thread-safe strtok version

Message ID 87v7rmixkm.fsf@oldenburg.str.redhat.com (mailing list archive)
State New
Headers
Series [v2] string: New thread-safe strtok version |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
redhat-pt-bot/TryBot-still_applies warning Patch no longer applies to master

Commit Message

Florian Weimer April 2, 2025, 11:59 a.m. UTC
  Introduce a new symbol version, so that applications can rely
on the new behavior.

The compatibility symbol is not thread-safe and switches to the
BSD-compatible behavior that some historic applications rely on.  See
the previous discussion on bug 16640.

---
v2: First patch submission was from the wrong local commit, sorry.

 NEWS                                               |  5 +-
 string/Makefile                                    |  4 ++
 string/Versions                                    |  3 ++
 string/strtok.c                                    | 21 +++++++-
 string/tst-strtok-compat.c                         | 63 ++++++++++++++++++++++
 string/tst-strtok-thread.c                         | 50 +++++++++++++++++
 sysdeps/generic/tls-internal-struct.h              |  1 +
 sysdeps/mach/hurd/i386/libc.abilist                |  1 +
 sysdeps/mach/hurd/x86_64/libc.abilist              |  1 +
 sysdeps/unix/sysv/linux/aarch64/libc.abilist       |  1 +
 sysdeps/unix/sysv/linux/alpha/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/arc/libc.abilist           |  1 +
 sysdeps/unix/sysv/linux/arm/be/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/arm/le/libc.abilist        |  1 +
 sysdeps/unix/sysv/linux/csky/libc.abilist          |  1 +
 sysdeps/unix/sysv/linux/hppa/libc.abilist          |  1 +
 sysdeps/unix/sysv/linux/i386/libc.abilist          |  1 +
 .../unix/sysv/linux/loongarch/lp64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/microblaze/be/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/microblaze/le/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips32/fpu/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips32/nofpu/libc.abilist |  1 +
 .../unix/sysv/linux/mips/mips64/n32/libc.abilist   |  1 +
 .../unix/sysv/linux/mips/mips64/n64/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/or1k/libc.abilist          |  1 +
 .../sysv/linux/powerpc/powerpc32/fpu/libc.abilist  |  1 +
 .../linux/powerpc/powerpc32/nofpu/libc.abilist     |  1 +
 .../sysv/linux/powerpc/powerpc64/be/libc.abilist   |  1 +
 .../sysv/linux/powerpc/powerpc64/le/libc.abilist   |  1 +
 sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist    |  1 +
 sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist  |  1 +
 sysdeps/unix/sysv/linux/sh/be/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/sh/le/libc.abilist         |  1 +
 sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist |  1 +
 sysdeps/unix/sysv/linux/x86_64/64/libc.abilist     |  1 +
 sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist    |  1 +
 41 files changed, 178 insertions(+), 3 deletions(-)


base-commit: c6e2895695118ab59c7b17feb0fcb75a53e3478c
  

Patch

diff --git a/NEWS b/NEWS
index 52cbf1a989..b84b333389 100644
--- a/NEWS
+++ b/NEWS
@@ -20,7 +20,10 @@  Major new features:
 
 Deprecated and removed features, and other changes affecting compatibility:
 
-  [Add deprecations, removals and changes affecting compatibility here]
+* For newly linked applications, the strtok function is now thread-safe.
+  The first call to strtok on each thread must have a non-null first
+  argument.  (It is recommended that applications and libraries in
+  particular use strtok_r.)
 
 Changes to build and runtime requirements:
 
diff --git a/string/Makefile b/string/Makefile
index c83b195e2e..9db84a8980 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -204,6 +204,8 @@  tests := \
   tst-strlcpy2 \
   tst-strlen \
   tst-strtok \
+  tst-strtok-compat \
+  tst-strtok-thread \
   tst-strtok_r \
   tst-strxfrm \
   tst-strxfrm2 \
@@ -307,5 +309,7 @@  $(objpfx)bug-strcoll2.out: $(gen-locales)
 $(objpfx)tst-strcoll-overflow.out: $(gen-locales)
 $(objpfx)tst-strsignal.out: $(gen-locales)
 $(objpfx)tst-strerror.out: $(gen-locales)
+$(objpfx)tst-strtok-compat.out: $(shared-thread-library)
+$(objpfx)tst-strtok-thread.out: $(shared-thread-library)
 
 endif
diff --git a/string/Versions b/string/Versions
index c56e372a3c..bbe4848307 100644
--- a/string/Versions
+++ b/string/Versions
@@ -96,4 +96,7 @@  libc {
     strlcat;
     strlcpy;
   }
+  GLIBC_2.42 {
+    strtok;
+  }
 }
diff --git a/string/strtok.c b/string/strtok.c
index d0c69afc1f..dcfbbcb169 100644
--- a/string/strtok.c
+++ b/string/strtok.c
@@ -16,7 +16,8 @@ 
    <https://www.gnu.org/licenses/>.  */
 
 #include <string.h>
-
+#include <tls-internal.h>
+#include <shlib-compat.h>
 
 /* Parse S into tokens separated by characters in DELIM.
    If S is NULL, the last string strtok() was called with is
@@ -28,8 +29,24 @@ 
 		// s = "abc\0=-def\0"
 */
 char *
-strtok (char *s, const char *delim)
+__strtok (char *s, const char *delim)
+{
+  struct tls_internal_t *tls_internal = __glibc_tls_internal ();
+  return __strtok_r (s, delim, &tls_internal->strtok_buf);
+}
+versioned_symbol (libc, __strtok, strtok, GLIBC_2_42);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_42)
+/* The previous version was not thread-safe.  */
+char *
+__strtok_old (char *s, const char *delim)
 {
   static char *olds;
+  if (olds == NULL && s == NULL)
+    /* Compatibility kludge for very old applications expecting BSD
+       behavior.  */
+    return NULL;
   return __strtok_r (s, delim, &olds);
 }
+compat_symbol (libc, __strtok_old, strtok, GLIBC_2_0);
+#endif
diff --git a/string/tst-strtok-compat.c b/string/tst-strtok-compat.c
new file mode 100644
index 0000000000..29912db535
--- /dev/null
+++ b/string/tst-strtok-compat.c
@@ -0,0 +1,63 @@ 
+/* Verify BSD-compatible behavior of non-thread-safe strtok.
+   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 <dlfcn.h>
+#include <first-versions.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/xthread.h>
+
+/* Compatibility symbol variant of strtok.  */
+static __typeof (strtok) *old_impl;
+
+static void *
+thread_func (void *ignored)
+{
+  TEST_COMPARE_STRING (old_impl (NULL, ":"), "bb");
+  return NULL;
+}
+
+static int
+do_test (void)
+{
+  old_impl = dlvsym (RTLD_DEFAULT, "strtok", FIRST_VERSION_libc_strtok_STRING);
+  TEST_VERIFY (old_impl != NULL);
+
+  /* Check to see if there is a distinct compatibility symbol.   */
+  if (old_impl == dlsym (RTLD_DEFAULT, "strtok"))
+    {
+      puts ("info: strtok is always thread-safe on this target");
+      return 0;
+    }
+
+  /* This tests the legacy BSD behavior.  */
+  TEST_VERIFY (old_impl (NULL, ":") == NULL);
+
+  /* Verify that the old implementation is not thread-safe.  */
+  char buf[] = "aa:bb:cc";
+  TEST_COMPARE_STRING (old_impl (buf, ":"), "aa");
+  xpthread_join (xpthread_create (NULL, thread_func, NULL));
+  TEST_COMPARE_STRING (old_impl (NULL, ":"), "cc");
+  TEST_COMPARE_STRING (old_impl (NULL, ":"), NULL);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/string/tst-strtok-thread.c b/string/tst-strtok-thread.c
new file mode 100644
index 0000000000..f4dfd2f5c1
--- /dev/null
+++ b/string/tst-strtok-thread.c
@@ -0,0 +1,50 @@ 
+/* Test that strtok uses a per-thread internal pointer.
+   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 <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <support/check.h>
+#include <support/xthread.h>
+
+static void *
+thread_func (void *ignored)
+{
+  char buf[] = "11,22,33";
+  TEST_COMPARE_STRING (strtok (buf, ","), "11");
+  TEST_COMPARE_STRING (strtok (NULL, ","), "22");
+  TEST_COMPARE_STRING (strtok (NULL, ","), "33");
+  TEST_COMPARE_STRING (strtok (NULL, ","), NULL);
+  return NULL;
+}
+
+static int
+do_test (void)
+{
+  /* Verify that the old implementation is not thread-safe.  */
+  char buf[] = "aa:bb:cc";
+  TEST_COMPARE_STRING (strtok (buf, ":"), "aa");
+  xpthread_join (xpthread_create (NULL, thread_func, NULL));
+  TEST_COMPARE_STRING (strtok (NULL, ":"), "bb");
+  TEST_COMPARE_STRING (strtok (NULL, ":"), "cc");
+  TEST_COMPARE_STRING (strtok (NULL, ":"), NULL);
+
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/sysdeps/generic/tls-internal-struct.h b/sysdeps/generic/tls-internal-struct.h
index b98db8a933..2c288c3f0f 100644
--- a/sysdeps/generic/tls-internal-struct.h
+++ b/sysdeps/generic/tls-internal-struct.h
@@ -23,6 +23,7 @@  struct tls_internal_t
 {
   char *strsignal_buf;
   char *strerror_l_buf;
+  char *strtok_buf;
 };
 
 #endif
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index 0b963dc890..6dc7cdbeec 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -2614,6 +2614,7 @@  GLIBC_2.42 pthread_rwlockattr_destroy F
 GLIBC_2.42 pthread_rwlockattr_getpshared F
 GLIBC_2.42 pthread_rwlockattr_init F
 GLIBC_2.42 pthread_rwlockattr_setpshared F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist
index b9e9349b9d..3e33f65bce 100644
--- a/sysdeps/mach/hurd/x86_64/libc.abilist
+++ b/sysdeps/mach/hurd/x86_64/libc.abilist
@@ -2297,6 +2297,7 @@  GLIBC_2.42 pthread_rwlockattr_destroy F
 GLIBC_2.42 pthread_rwlockattr_getpshared F
 GLIBC_2.42 pthread_rwlockattr_init F
 GLIBC_2.42 pthread_rwlockattr_setpshared F
+GLIBC_2.42 strtok F
 HURD_CTHREADS_0.3 __cthread_getspecific F
 HURD_CTHREADS_0.3 __cthread_keycreate F
 HURD_CTHREADS_0.3 __cthread_setspecific F
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 41f8f39911..365b989a6c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2753,3 +2753,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 34efc96781..100f2bb163 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -3100,6 +3100,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index de7c618d28..0f2454e0b9 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -2514,3 +2514,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 96f0314b16..38b3737bb9 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -2806,6 +2806,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
index 635468fa13..6850f18350 100644
--- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist
@@ -2803,6 +2803,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist
index 490694ddce..496ce08599 100644
--- a/sysdeps/unix/sysv/linux/csky/libc.abilist
+++ b/sysdeps/unix/sysv/linux/csky/libc.abilist
@@ -2790,3 +2790,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist
index b1905da767..1ffd0eb740 100644
--- a/sysdeps/unix/sysv/linux/hppa/libc.abilist
+++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist
@@ -2827,6 +2827,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist
index 424ef34a8b..5e861ed8e5 100644
--- a/sysdeps/unix/sysv/linux/i386/libc.abilist
+++ b/sysdeps/unix/sysv/linux/i386/libc.abilist
@@ -3010,6 +3010,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
index 420471eb24..7188bc6a39 100644
--- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist
@@ -2274,3 +2274,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
index 95a68c7cc1..b145680279 100644
--- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist
@@ -2786,6 +2786,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
index 442e82b6d2..2fe344ce88 100644
--- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
+++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist
@@ -2953,6 +2953,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
index 20f7712988..6970337d80 100644
--- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist
@@ -2839,3 +2839,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
index f61ed3bf26..d19403de12 100644
--- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist
@@ -2836,3 +2836,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
index 381120cc16..fc0137712f 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist
@@ -2914,6 +2914,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
index 2f51146084..75e68629a7 100644
--- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist
@@ -2912,6 +2912,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
index e6071be2ae..dc83fdebf6 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist
@@ -2920,6 +2920,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
index f41e209a2b..0015524bd3 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist
@@ -2822,6 +2822,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist
index bbcdb31f09..f964275870 100644
--- a/sysdeps/unix/sysv/linux/or1k/libc.abilist
+++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist
@@ -2264,3 +2264,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
index e0ea22b9c6..dad1cdc8dd 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist
@@ -3143,6 +3143,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
index 16b9a771f1..c6aa089cf4 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist
@@ -3188,6 +3188,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
index 070f6f5a08..025c94f529 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist
@@ -2897,6 +2897,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
index 4378d1d922..fa1037aca3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist
@@ -2973,3 +2973,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
index 48c6e269a5..68d2c9189a 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist
@@ -2517,3 +2517,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
index a8b0c6aca7..f7f10adbf7 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist
@@ -2717,3 +2717,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
index 6c00b8440b..eff56121d1 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist
@@ -3141,6 +3141,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
index f866e5d6f3..b13e41de70 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist
@@ -2934,6 +2934,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
index 4f2db8cb9b..a3dfe295e1 100644
--- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist
@@ -2833,6 +2833,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
index a73473ee32..54e02eba3f 100644
--- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist
@@ -2830,6 +2830,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index dc7e27db2a..b07ff8c555 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -3162,6 +3162,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
index 2ee97f42fb..d2cabf67d2 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist
@@ -2798,6 +2798,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
index a7ada1ea53..4d84c99a79 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist
@@ -2749,6 +2749,7 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F
 GLIBC_2.5 __readlinkat_chk F
 GLIBC_2.5 inet6_opt_append F
 GLIBC_2.5 inet6_opt_find F
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
index f41ab77c1e..9deaf562c8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist
@@ -2768,3 +2768,4 @@  GLIBC_2.41 sched_setattr F
 GLIBC_2.42 __inet_ntop_chk F
 GLIBC_2.42 __inet_pton_chk F
 GLIBC_2.42 pthread_gettid_np F
+GLIBC_2.42 strtok F