From patchwork Mon Apr 14 17:41:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 881019 Delivered-To: patch@linaro.org Received: by 2002:adf:f902:0:b0:38f:210b:807b with SMTP id b2csp60278wrr; Mon, 14 Apr 2025 10:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzx/EVMTeD2fQuAmwovCzGPWeyhZST+nWcPv0yqULrNT87Od53bWujtzb4/V9YA26An2t2Sw==@linaro.org X-Google-Smtp-Source: AGHT+IEMuhl92iINQs/dkYxc0csEO+ZJ7M/hgfuetpIPdNSqSc9HscHGIwpmuzxxkFX71YQXAe6c X-Received: by 2002:a05:622a:1496:b0:477:6bf4:4f5d with SMTP id d75a77b69052e-47977516a87mr152353681cf.7.1744652534090; Mon, 14 Apr 2025 10:42:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1744652534; cv=pass; d=google.com; s=arc-20240605; b=cC5bqHEMXRXSeAs3Ovjqy0JsFEln1vbtv/o9jkDjxUcJBGVH48lGbJlNj8UDFLDICZ jeYOgXAQpI4ukbltcncfVy1yZjCqWxcRnbDwyobAQ9KCtyPGKcH/aMeT0roHE8g4CnB8 LzNdwtImhsRLwZ+bK09zcZuOHbqPX7DkjT1A+ziLYcKK5ZprETBzFH6E6M5YpT1zaLoX qZd9IOv+98JihGb3TGPxVROHzOOd/8yzRmcW4JkZufzKOzi60YhS/DqI2rKLqEBxKNwj WgkRwo++aUCEuhMeCczzO1Pm49CKuVxf/PHkZ8uJLdyaGEFaMyqj6gqwPCAsZ+YC7Ear MMSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter:arc-filter:dmarc-filter:delivered-to:dkim-filter; bh=MOFko2mSA5RClK5yhlFJwQDdowl2qrf9P3/hkam6Lpc=; fh=NVAgZHYLkprGj7bh2O79ffGQg+/n9ynQ9fCbvxqLnbk=; b=Dvdn0qrGcuHqkuIbrphhIv88a0lAHyyLmSCqPCiOU6y4zbxL1FKlU1irtpP0cBH+uP YXzB5U9bLuqBSnSOIbXv4hkrQvWTXn/iXKLdDtU4UPRVDN0KV+RiYER0FSvwRkHkhw7+ B+tuWqbu0YktcyXrpSIbNIz/IPAhTLtefe8y7Bbb2KLFEs9kAJ122Mb8Qyx684NdFGh/ RQnIbphWdcH2t9TSDPWSZbFVdR0+ajHOkfnWliURdQk4COi7NblB8Zjm7r3GqgOFNxnJ 7fyTCj7khj+ZhJSBlxY7QzmaOGaq4YF77UeP3f8OBlStrQdckfJzUhfb/rg5DaqmwF2H 63TA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tLzR87qi; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d75a77b69052e-4796edd313dsi92389131cf.348.2025.04.14.10.42.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Apr 2025 10:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tLzR87qi; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A76E3857B90 for ; Mon, 14 Apr 2025 17:42:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A76E3857B90 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tLzR87qi X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id D7034385840C for ; Mon, 14 Apr 2025 17:41:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D7034385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D7034385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::631 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744652504; cv=none; b=h2NUuLgWij9FY0HUY3Pb9Ca7L3WL/+7jYjh4EeBJi0ehm+/nW8ZgdmlzzHjj7RxgRtzzJWIMVi9l58Knbnw+uLRXbe9zJSUi1l9jsQhR8OtSOXxToWpuvQ45FjdEfekZ8sqk+BaTIIgi3Ng9V78U3so+3a8Gv0Ibu4GqR10wIM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744652504; c=relaxed/simple; bh=L5iBhjfkcdu8Yz4WnIhN17EhkjYQqO290NSvCvbH3aw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YD2/KHyl1cNbL/0scpct+Ex5fMZkPAOfK0bjvaODSDt0NdcDi6x6aujjCAZA6d0sjZbc+0OE1EDXlsyVv6p9t6oUIc1ppqBvhoP8srwZ7ct1wyFHtzjSmPfvxgAsjd+OAVPOtgg3oZH2J8A6yW7a1zZDKC0oTGcbE74sNcyrRDQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7034385840C Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-22403cbb47fso49318815ad.0 for ; Mon, 14 Apr 2025 10:41:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1744652502; x=1745257302; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MOFko2mSA5RClK5yhlFJwQDdowl2qrf9P3/hkam6Lpc=; b=tLzR87qizMjiWhZTFn2WV7rOVwhbo5y+pjT1nA7qt3tPEdF0uKaSeSC6ZhWRIqTUix B6HtPocSVvG0KKjW8ghv2IiOG4qIVcNKZXFHecSqQuXydrY/ctcJzDZCtlU8v5WD665g SQIKGc0YfHAQM7L/AOdm3Tyfx1Us3FvTiUwGuYdw41Uae9u9xqTTVD+AXHLaeP4bAlEa ftWO4ovxD99HQfd4591OW3ljy6hTUHAEuvWWefNk9EIfkYrbADyOMILYIv7qbdvbuGt1 1u/6ATQWgYIacEtxAzG6L8KAVzpjHM9crTgNfCfzEH/siubIr+z3rR7K0I+qhGF/0pq1 /1KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744652502; x=1745257302; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MOFko2mSA5RClK5yhlFJwQDdowl2qrf9P3/hkam6Lpc=; b=n/IfajCsUmWa5FEnHx0ItZErwaTJNSdKgmgJs51ZXcEjV2Nk7jVhh0/DkkjNYLcVZD 1NOZmOmWO9vw/GfRxPp+RaUvXUvoi9/8nI0Zl2on4HTDJk/fCuZCVAIz8rK5PXi4e2MM FALaEPfPUUX5uUsvhSZqE81ZgFTBWhA+tSqoGsO1oX6AAnTcaFJI7es6/ogUPWqnlOBY 1QYmNNej9f+nR2KPCh9axcmU1zLMjUyqskGcUJLZFEcneORKXA/KxRDpmInwDTcI+AwV 3NRDUIJw9Ug1egX8Jy0XqrYaK8IBy/u4NWzmu2pWOdk4Gt/pg4Tfm28oU82pn0yhosAI 7iEA== X-Gm-Message-State: AOJu0Ywzew8+zTK1YtJ8e+7f4bLxmeQpT5U7uApvTopUvvb/d0DtPNpd Zrd9s1dItT/mpCuMtn2CVxsqtMgB0wsHouXtEcOf4qIJnOH+kxRBLuwt7yaEs+FpatjOXd/Bzei P X-Gm-Gg: ASbGncuo+/UqWdmvW/2enKsZtSA4xnBukI8wuuT2G3605K4yczu02fVN75WA0qoSvQ+ FqYYMIoOiw9+2Zichofg2xXukFD1R2UMFfceFlzVweFaU4jGj4iEPxJeqWIdzcmFiLNb51yGrad YwUuecbE3reExHwSjWqqLGGBjaa7n81ndwM2+a1xvGcPi2kmAGsmCs9CtER6HhPCPaPDshU/raN Ji/IS9NFFNVdWLhjXGJ392NyMr+3V8pjw00lA1aHFTNuIvgYiTDXdbmj9adR4uoJeWShS4PYZJG 7HUVudMFtZQz3Mpa9ZaKJ7GEC4hfuzgKkkZR6kNZ/pPYsLjNHvHawQ== X-Received: by 2002:a17:902:f705:b0:227:ac2a:1dd6 with SMTP id d9443c01a7336-22bea4c6e17mr239565975ad.24.1744652502121; Mon, 14 Apr 2025 10:41:42 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:61f1:b5cf:120b:d45e:cfb3]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73bd21c338fsm6880215b3a.43.2025.04.14.10.41.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Apr 2025 10:41:41 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Carlos O'Donell , =?utf-8?q?Cristian_Rodr=C3=ADguez?= , Andreas Schwab Subject: [PATCH v3] stdlib: Consolidate getentropy and adapt to POSIX 2024 semantics Date: Mon, 14 Apr 2025 14:41:25 -0300 Message-ID: <20250414174137.2602932-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org POSIX.1-2024 added getentropy with some slight different semantics, where buffer larger than 256 (GETENTROPY_MAX) should return EINVAL insted of EIO. So a a new compat symbol is added to return EIO for large buffer, and if no entropy could ge obtained from __getrandom_nocancel. This patch does not move getentropy definition to unistd.h nor add GETENTROPY_MAX on limits.h, since glibc still does not have a preprocessor handling for POSIX 2024. The consolidation uses __getrandom_nocancel, which might uses the vDSO implementation if supported. Checked on x86_64-linux-gnu. --- NEWS | 3 + manual/crypt.texi | 2 +- stdlib/Makefile | 8 ++ stdlib/Versions | 1 + stdlib/getentropy.c | 61 +++++++++- stdlib/tst-getentropy-compat.c | 26 +++++ stdlib/tst-getentropy.c | 108 ++++++++++++++++++ stdlib/tst-getrandom.c | 71 +----------- sysdeps/mach/hurd/getentropy.c | 59 ---------- sysdeps/mach/hurd/i386/libc.abilist | 3 +- 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/getentropy.c | 65 ----------- sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + .../sysv/linux/loongarch/lp64/libc.abilist | 1 + .../sysv/linux/m68k/coldfire/libc.abilist | 1 + .../unix/sysv/linux/m68k/m680x0/libc.abilist | 1 + .../sysv/linux/microblaze/be/libc.abilist | 1 + .../sysv/linux/microblaze/le/libc.abilist | 1 + .../sysv/linux/mips/mips32/fpu/libc.abilist | 1 + .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + .../sysv/linux/mips/mips64/n64/libc.abilist | 1 + sysdeps/unix/sysv/linux/or1k/libc.abilist | 1 + .../linux/powerpc/powerpc32/fpu/libc.abilist | 1 + .../powerpc/powerpc32/nofpu/libc.abilist | 1 + .../linux/powerpc/powerpc64/be/libc.abilist | 1 + .../linux/powerpc/powerpc64/le/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 + .../unix/sysv/linux/riscv/rv64/libc.abilist | 1 + .../unix/sysv/linux/s390/s390-32/libc.abilist | 1 + .../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 + .../sysv/linux/sparc/sparc32/libc.abilist | 1 + .../sysv/linux/sparc/sparc64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + 43 files changed, 237 insertions(+), 202 deletions(-) create mode 100644 stdlib/tst-getentropy-compat.c create mode 100644 stdlib/tst-getentropy.c delete mode 100644 sysdeps/mach/hurd/getentropy.c delete mode 100644 sysdeps/unix/sysv/linux/getentropy.c diff --git a/NEWS b/NEWS index 740225ad12..924ab43cdf 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,9 @@ Deprecated and removed features, and other changes affecting compatibility: programs that require an executable stack through dynamic loaded shared libraries. +* The getentropy function now follows POSIX 2024, which means that + unsupportd large buffer will return EINVAL instead of EIO. + Changes to build and runtime requirements: * GCC 12.1 or later is now required to build the GNU C Library. diff --git a/manual/crypt.texi b/manual/crypt.texi index 4882ee34e5..ce68f2853a 100644 --- a/manual/crypt.texi +++ b/manual/crypt.texi @@ -73,7 +73,7 @@ used by this function was added to the Linux kernel in version 3.17.) The combination of @var{buffer} and @var{length} arguments specifies an invalid memory range. -@item EIO +@item EINVAL @var{length} is larger than 256, or the kernel entropy pool has suffered a catastrophic failure. @end table diff --git a/stdlib/Makefile b/stdlib/Makefile index 1c80e497f0..831247d16a 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -284,6 +284,7 @@ tests := \ tst-environ-change-2 \ tst-environ-change-3 \ tst-environ-change-4 \ + tst-getentropy \ tst-getenv-signal \ tst-getenv-static \ tst-getenv-thread \ @@ -401,6 +402,13 @@ tests += \ # tests endif +# Test for the getentropy symbol versions required for POSIX 2024 +ifeq ($(have-GLIBC_2.42)$(build-shared),yesyes) +tests += \ + tst-getentropy-compat \ + # tests +endif + LDLIBS-test-atexit-race = $(shared-thread-library) LDLIBS-test-at_quick_exit-race = $(shared-thread-library) LDLIBS-test-cxa_atexit-race = $(shared-thread-library) diff --git a/stdlib/Versions b/stdlib/Versions index 6d024000f8..66e61e1441 100644 --- a/stdlib/Versions +++ b/stdlib/Versions @@ -224,6 +224,7 @@ libc { stdc_bit_ceil_ull; } GLIBC_2.42 { + getentropy; uabs; uimaxabs; ulabs; diff --git a/stdlib/getentropy.c b/stdlib/getentropy.c index 5149fbdde0..dfc48168f1 100644 --- a/stdlib/getentropy.c +++ b/stdlib/getentropy.c @@ -16,16 +16,65 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include +#include +#include +#include /* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success and -1 on failure. */ -int -getentropy (void *buffer, size_t length) +static int +getentropy_base (void *buffer, size_t length, int err) { - __set_errno (ENOSYS); - return -1; + if (length > 256) + { + __set_errno (err); + return -1; + } + + /* Try to fill the buffer completely. Even with the 256 byte limit + above, we might still receive an EINTR error (when blocking + during boot). */ + void *end = buffer + length; + while (buffer < end) + { + /* NB: No cancellation point. */ + ssize_t bytes = __getrandom_nocancel (buffer, end - buffer, 0); + if (bytes < 0) + { + if (errno == EINTR) + /* Try again if interrupted by a signal. */ + continue; + else + return -1; + } + else if (bytes == 0) + /* No more bytes available. This should not happen under normal + circumstances. */ + { + __set_errno (err); + return -1; + } + + /* Try again in case of a short read. */ + buffer += bytes; + } + return 0; } -stub_warning (getentropy) +int +__new_getentropy (void *buffer, size_t length) +{ + return getentropy_base (buffer, length, EINVAL); +} +versioned_symbol (libc, __new_getentropy, getentropy, GLIBC_2_42); + +#if SHLIB_COMPAT (libc, GLIBC_2_25, GLIBC_2_42) +int +__old_getentropy (void *buffer, size_t length) +{ + return getentropy_base (buffer, length, EIO); +} +compat_symbol (libc, __old_getentropy, getentropy, GLIBC_2_25); +#endif diff --git a/stdlib/tst-getentropy-compat.c b/stdlib/tst-getentropy-compat.c new file mode 100644 index 0000000000..388edda7e0 --- /dev/null +++ b/stdlib/tst-getentropy-compat.c @@ -0,0 +1,26 @@ +/* Compat tests for the getentropy function. + Copyright (C) 2016-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 + . */ + +#include + +#include + +compat_symbol_reference (libc, getentropy, getentropy, GLIBC_2_25); + +#define ERRNO_BUFFER_TO_LARGE EIO +#include "tst-getentropy.c" diff --git a/stdlib/tst-getentropy.c b/stdlib/tst-getentropy.c new file mode 100644 index 0000000000..eef57fca2c --- /dev/null +++ b/stdlib/tst-getentropy.c @@ -0,0 +1,108 @@ +/* Tests for the getentropy function. + Copyright (C) 2016-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 + . */ + +#include +#include +#include +#include +#include + +#ifndef ERRNO_BUFFER_TO_LARGE +# define ERRNO_BUFFER_TO_LARGE EINVAL +#endif + +/* Set to true if any errors are encountered. */ +static bool errors; + +static void +test_getentropy (void) +{ + char buf[16]; + memset (buf, '@', sizeof (buf)); + if (getentropy (buf, 0) != 0) + { + printf ("error: getentropy zero length: %m\n"); + errors = true; + return; + } + for (size_t i = 0; i < sizeof (buf); ++i) + if (buf[i] != '@') + { + printf ("error: getentropy modified zero-length buffer\n"); + errors = true; + return; + } + + if (getentropy (buf, sizeof (buf)) != 0) + { + printf ("error: getentropy buf: %m\n"); + errors = true; + return; + } + + char buf2[256]; + _Static_assert (sizeof (buf) < sizeof (buf2), "buf and buf2 compatible"); + memset (buf2, '@', sizeof (buf2)); + if (getentropy (buf2, sizeof (buf)) != 0) + { + printf ("error: getentropy buf2: %m\n"); + errors = true; + return; + } + + /* The probability that these two buffers are equal is very + small. */ + if (memcmp (buf, buf2, sizeof (buf)) == 0) + { + printf ("error: getentropy appears to return constant bytes\n"); + errors = true; + return; + } + + for (size_t i = sizeof (buf); i < sizeof (buf2); ++i) + if (buf2[i] != '@') + { + printf ("error: getentropy wrote beyond the end of the buffer\n"); + errors = true; + return; + } + + char buf3[257]; + if (getentropy (buf3, sizeof (buf3)) == 0) + { + printf ("error: getentropy successful for 257 byte buffer\n"); + errors = true; + return; + } + if (errno != ERRNO_BUFFER_TO_LARGE) + { + printf ("error: getentropy wrong error for 257 byte buffer: %m\n"); + errors = true; + return; + } +} + +static int +do_test (void) +{ + test_getentropy (); + + return errors; +} + +#include diff --git a/stdlib/tst-getrandom.c b/stdlib/tst-getrandom.c index 3b2153376b..e8b3392db5 100644 --- a/stdlib/tst-getrandom.c +++ b/stdlib/tst-getrandom.c @@ -1,4 +1,4 @@ -/* Tests for the getentropy, getrandom functions. +/* Tests for the getrandom functions. Copyright (C) 2016-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -151,73 +151,6 @@ test_flags (unsigned int flags) } } -static void -test_getentropy (void) -{ - char buf[16]; - memset (buf, '@', sizeof (buf)); - if (getentropy (buf, 0) != 0) - { - printf ("error: getentropy zero length: %m\n"); - errors = true; - return; - } - for (size_t i = 0; i < sizeof (buf); ++i) - if (buf[i] != '@') - { - printf ("error: getentropy modified zero-length buffer\n"); - errors = true; - return; - } - - if (getentropy (buf, sizeof (buf)) != 0) - { - printf ("error: getentropy buf: %m\n"); - errors = true; - return; - } - - char buf2[256]; - _Static_assert (sizeof (buf) < sizeof (buf2), "buf and buf2 compatible"); - memset (buf2, '@', sizeof (buf2)); - if (getentropy (buf2, sizeof (buf)) != 0) - { - printf ("error: getentropy buf2: %m\n"); - errors = true; - return; - } - - /* The probability that these two buffers are equal is very - small. */ - if (memcmp (buf, buf2, sizeof (buf)) == 0) - { - printf ("error: getentropy appears to return constant bytes\n"); - errors = true; - return; - } - - for (size_t i = sizeof (buf); i < sizeof (buf2); ++i) - if (buf2[i] != '@') - { - printf ("error: getentropy wrote beyond the end of the buffer\n"); - errors = true; - return; - } - - char buf3[257]; - if (getentropy (buf3, sizeof (buf3)) == 0) - { - printf ("error: getentropy successful for 257 byte buffer\n"); - errors = true; - return; - } - if (errno != EIO) - { - printf ("error: getentropy wrong error for 257 byte buffer: %m\n"); - errors = true; - return; - } -} static int do_test (void) @@ -237,8 +170,6 @@ do_test (void) test_flags (flags); } - test_getentropy (); - return errors; } diff --git a/sysdeps/mach/hurd/getentropy.c b/sysdeps/mach/hurd/getentropy.c deleted file mode 100644 index 6ad8acc773..0000000000 --- a/sysdeps/mach/hurd/getentropy.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Implementation of getentropy based on getrandom. - Copyright (C) 2016-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 - . */ - -#include -#include -#include -#include -#include - -/* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on - success and -1 on failure. */ -int -getentropy (void *buffer, size_t length) -{ - /* The interface is documented to return EIO for buffer lengths - longer than 256 bytes. */ - if (length > 256) - return __hurd_fail (EIO); - - /* Try to fill the buffer completely. Even with the 256 byte limit - above, we might still receive an EINTR error (when blocking - during boot). */ - void *end = buffer + length; - while (buffer < end) - { - /* NB: No cancellation point. */ - ssize_t bytes = __getrandom (buffer, end - buffer, 0); - if (bytes < 0) - { - if (errno == EINTR) - /* Try again if interrupted by a signal. */ - continue; - else - return -1; - } - if (bytes == 0) - /* No more bytes available. This should not happen under - normal circumstances. */ - return __hurd_fail (EIO); - /* Try again in case of a short read. */ - buffer += bytes; - } - return 0; -} diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 3e183f5c02..a78bd46bf4 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -686,7 +686,7 @@ GLIBC_2.2.6 _libc_intl_domainname D 0x5 GLIBC_2.2.6 _longjmp F GLIBC_2.2.6 _mcleanup F GLIBC_2.2.6 _mcount F -GLIBC_2.2.6 _nl_default_dirname D 0xe +GLIBC_2.2.6 _nl_default_dirname D 0x12 GLIBC_2.2.6 _nl_domain_bindings D 0x4 GLIBC_2.2.6 _nl_msg_cat_cntr D 0x4 GLIBC_2.2.6 _null_auth D 0xc @@ -2586,6 +2586,7 @@ GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_barrier_destroy F GLIBC_2.42 pthread_barrier_init F GLIBC_2.42 pthread_barrier_wait F diff --git a/sysdeps/mach/hurd/x86_64/libc.abilist b/sysdeps/mach/hurd/x86_64/libc.abilist index 688ee26f4b..d7c995467c 100644 --- a/sysdeps/mach/hurd/x86_64/libc.abilist +++ b/sysdeps/mach/hurd/x86_64/libc.abilist @@ -2269,6 +2269,7 @@ GLIBC_2.41 pthread_mutexattr_settype F GLIBC_2.41 pthread_sigmask F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_barrier_destroy F GLIBC_2.42 pthread_barrier_init F GLIBC_2.42 pthread_barrier_wait F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index aa6bf483dd..7192a375c7 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2752,6 +2752,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index d5df9656a8..4897a1eda3 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -3099,6 +3099,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index c46c08da85..bd05d804fa 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2513,6 +2513,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 4df150c0f0..8988ae7fb2 100644 --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist @@ -2805,6 +2805,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/sysv/linux/arm/le/libc.abilist index be294783f6..1e96f1ea15 100644 --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist @@ -2802,6 +2802,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sysv/linux/csky/libc.abilist index f123757134..3918a8050d 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2789,6 +2789,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/getentropy.c b/sysdeps/unix/sysv/linux/getentropy.c deleted file mode 100644 index a62c9fb099..0000000000 --- a/sysdeps/unix/sysv/linux/getentropy.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Implementation of getentropy based on the getrandom system call. - Copyright (C) 2016-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 - . */ - -#include -#include -#include -#include -#include - -/* Write LENGTH bytes of randomness starting at BUFFER. Return 0 on - success and -1 on failure. */ -int -getentropy (void *buffer, size_t length) -{ - /* The interface is documented to return EIO for buffer lengths - longer than 256 bytes. */ - if (length > 256) - { - __set_errno (EIO); - return -1; - } - - /* Try to fill the buffer completely. Even with the 256 byte limit - above, we might still receive an EINTR error (when blocking - during boot). */ - void *end = buffer + length; - while (buffer < end) - { - /* NB: No cancellation point. */ - ssize_t bytes = INLINE_SYSCALL_CALL (getrandom, buffer, end - buffer, 0); - if (bytes < 0) - { - if (errno == EINTR) - /* Try again if interrupted by a signal. */ - continue; - else - return -1; - } - if (bytes == 0) - { - /* No more bytes available. This should not happen under - normal circumstances. */ - __set_errno (EIO); - return -1; - } - /* Try again in case of a short read. */ - buffer += bytes; - } - return 0; -} diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 2dc85b9533..db918318b7 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -2826,6 +2826,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 1e38217ec6..ef7c795d38 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -3009,6 +3009,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist index 927fc21445..4217ddb699 100644 --- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist @@ -2273,6 +2273,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 74da49d9da..b603a4840b 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -2785,6 +2785,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index e5d678111f..edcfc46c2a 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -2952,6 +2952,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist index 4dbd4b6045..68033dca20 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2838,6 +2838,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index c5965bb50c..97c998c25e 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2835,6 +2835,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 10715e0777..4f00b3e5e0 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -2913,6 +2913,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index e4cb45275b..e6b95b7a5e 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -2919,6 +2919,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 8a32d2585d..2ce6b68ee6 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -2821,6 +2821,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/or1k/libc.abilist b/sysdeps/unix/sysv/linux/or1k/libc.abilist index 64dac95b2a..269e28cb3a 100644 --- a/sysdeps/unix/sysv/linux/or1k/libc.abilist +++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist @@ -2263,6 +2263,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index cc5e93c77c..a65c3f5fe1 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -3142,6 +3142,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 9814997083..b26c757851 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -3187,6 +3187,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist index 7f46295c11..78227800b7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist @@ -2896,6 +2896,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist index f24f81bb5f..7bcb0b264a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2972,6 +2972,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index 9330c7ab76..ad6e216259 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2516,6 +2516,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index ea4555d39e..8bb540b346 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2716,6 +2716,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 3e625fa4e9..841e85d5f1 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -3140,6 +3140,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 46b4a04f65..e81ed62b8a 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -2933,6 +2933,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sysv/linux/sh/be/libc.abilist index 36a94c9210..76688bd6f1 100644 --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist @@ -2832,6 +2832,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sysv/linux/sh/le/libc.abilist index f79aba6aab..f628a736ab 100644 --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist @@ -2829,6 +2829,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 4a6acc08e0..7e45529bb4 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -3161,6 +3161,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index 931109dab1..21d700782b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -2797,6 +2797,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 7ab9073e3a..2fcc262c70 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2748,6 +2748,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index e11876f6ab..154f10aae6 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2767,6 +2767,7 @@ GLIBC_2.41 sched_getattr F GLIBC_2.41 sched_setattr F GLIBC_2.42 __inet_ntop_chk F GLIBC_2.42 __inet_pton_chk F +GLIBC_2.42 getentropy F GLIBC_2.42 pthread_gettid_np F GLIBC_2.42 uabs F GLIBC_2.42 uimaxabs F