From patchwork Thu Mar 27 14:16:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 876558 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp51608wrs; Thu, 27 Mar 2025 07:18:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAJIG7Uq1tFRr3RDYuH1XYdQ6XrXwmSV+R6P8SLp4BQUbxoufiGJSMgoB/t3JYVxztlYACvw==@linaro.org X-Google-Smtp-Source: AGHT+IE3+ARV4dcu+bYnG9++Zrnj2bQgXX56NE4UdcSyoPW2AokeL8pzuY7HonlgjZ/kF8SXjGHQ X-Received: by 2002:a05:620a:3196:b0:7c3:ded7:6330 with SMTP id af79cd13be357-7c5ed9f2c0amr508695585a.13.1743085106040; Thu, 27 Mar 2025 07:18:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1743085106; cv=pass; d=google.com; s=arc-20240605; b=k7u2yol+11GINP3rckl9qpJjAMLwcTQzPivrYSHvuMR+3VOK2LooUnvCX2O12Pbdh9 z4qP4JBI/1zRA63F+e/FykgRAbdufQpOwbvLtDfqwt2M0pZrAvBpC1wI9alNzxabMLTf mVdC2niDognTwRjSKZ4WaY7kARmajoyiEe34vmsyxehqIMSkOToBQwl1GJep/fEZEb1d 1MDvocmYWTnTZz4BpllutHDB7ogUzZpvSMjgvW2mgrkZTDw3nVQj6vLRsq/Zc2JhP53H hnxgycJuSumZ1Sgh4MSM5Pbw3DX4HC4WZ4YeEgirZp8hTDZtlEvboXXbqEkHuZXbWA66 P3qA== 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=JOBe5FBkoGgQFj+Z2pHn+zpeu3epx8v42bHY3s6Qjrc=; fh=DydK9HPvHx9L67MsNTwVYv+ot39gg788xG0XqALLCoM=; b=F9hDV1RT9/OElVuQqpsuQzaKBKv6a5q/QAZGSx6YQTQ9IvA+2v2tDYjfQ3P2kBln27 JVXfIHvVU3PxZ5iwbYrIgmqEseARxoy3YyGbwM6zO/QtlnFSEoDRvGtnqgBVyM7mh0F3 AzLi1is+h+n3snETqXJuFigdMJqy/rX8lzzE9PrqluyikybsQuFqUGw0Sx0C0z4z1KKi v7u+C/LBjcvaHz3rdduJ+zwbHLcJt0pPJ44RdtrBQTJHeB3Zz+gyRo8CTE4pFo6jjuOX kzT6yDwc40dmeai6QusmE+E3RZzh4N96NddEnCHdOMStDIrIbhdJqyDv+ZpJ0nP7VBep Agkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GKT+3WsY; 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 af79cd13be357-7c5b92ce8f9si1382499985a.193.2025.03.27.07.18.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Mar 2025 07:18:26 -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=GKT+3WsY; 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 945FD3857356 for ; Thu, 27 Mar 2025 14:18:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 945FD3857356 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=GKT+3WsY X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id A5AE93858C48 for ; Thu, 27 Mar 2025 14:18:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5AE93858C48 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 A5AE93858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1036 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743085080; cv=none; b=uZJtlnpLT1XxtlqB0qsBiGjuBSgOkQ3ZFwmEqryQrW4PbRVhdEVW/cJX9whCD4iwZEN9sFp6oEsWMq1TAkoiPPgbbZ1OwQECBp6YbGzyVQZ8fIX/nvehyGl2VsfH3Tux3xcSVh43SL/a3ZpRvjl69t1NwFnhBiCK31JD1vy/mSw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743085080; c=relaxed/simple; bh=c2uNWFOwv1vTDmJHEsSRxs2rEHHseCb2AWRYzKLERsU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kb/vpOOkANptD5iLRj+Om1fqbAc8zV9K8D4UsOqH4/2nRY/JbU3uo+XFJixTC+ZJyL4CavYWzhXqLPxk8q7xpKo+mzJk/ZcY/VyMFGa4rFcdVi+lN4+j2qctCuTdTgcw40sxfH0LXZjxqcZVFdabrf0OYS0bwuyBsGqNCZuXBbI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5AE93858C48 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2ff64550991so1238000a91.0 for ; Thu, 27 Mar 2025 07:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743085079; x=1743689879; 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=JOBe5FBkoGgQFj+Z2pHn+zpeu3epx8v42bHY3s6Qjrc=; b=GKT+3WsYikg+p2Cex4oOgFyhjOFAp5hInlRiK4dHfVsGtfKv2g26s6dqAUIM4jgZWs buXy2CXdU6pT1+DQlz4NxcQlLYcwGQ7QawP6Ndj2mGQLDocDSoyU+Hu74yDC1pDbToMZ JfpazUF4FioO3M6+GgDCeXAOZvNgDRoGUHuAmNq5We/nj40eeaOjyvBjLNcnU4LMTjNb wF7qtnc7YDrcXHf7o7VpMUZW+tz//qcdbZYc/IXSo51+/r3DV7Y68OP19sRNIBJW9y7r roWxH8QXTxeC3N0PTkmb2xxVOTnw4+uxhwl0HLD5vp6Fiq2skgOpxTvBI952L/XlpJJs NjEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743085079; x=1743689879; 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=JOBe5FBkoGgQFj+Z2pHn+zpeu3epx8v42bHY3s6Qjrc=; b=qi8n70m9r3wYMJY0s/SsUc5+5QiVK6vYqtsmlojvx9T/x0WIBx9yuHywqiZ5snvED6 MxTIxArXWLA+xGmye9hMC78ff2k5xgwqQ6JcLPQrlRBSSNB9KIUt14pi6QXH8jRpuLYt SuMJh6fi6hLt7rPOfFDb1ZIV8yyuL/pEtcEYKBb2qWO9z6R9nuO1U+UhgHIwTk00Qs3P BNlaRtTBQsroA9qiDe9wUahf/ibwK/ihCwSkkki2XUWXWQrheeGCTG0HWp6lMCqbVyNQ F4GKHXKbdqazrqYJDAGoqYPib8uL9bh2I2eKgcSjj4oJMvvPslycyHvDa8JPtcUPDdz0 0m+A== X-Gm-Message-State: AOJu0YxpfS0l1BQHnmncAylb4HbIAKz1gFP8ylOOTtgnrVdF0ZAajENL U/e/RJ4IbJRQCeqeGVMX1EApizDWNVNcFTaoajJUNtVsHXWzrkTkkAAe4ejdPyZIeI77FfVpthb G X-Gm-Gg: ASbGncunZ9gY5y2DtpKonFqOCR2YXyQc92hjJD7LFxC53SqzHFC4KKnUHwlpIvxcaNO EJ58Eaq+jpXGs+T8OJOCRU2o9F3t8jcwDWoQy4gK/g5TmWhm00FR5JABvtb/vM/2mGblu02aesj 3l9LlDzkWr41ikd6mBGtgtqvj1M8cEo0XIS3thgDGQnoSN5gsuYpszJ6NzxNquNnBeHdFLjEgj0 n749XieiCzhJeOWPEAfEKp2zGqrZOK0Z9QGjnOiknx0woDQKJJkZ0Ql1A2jFhmQ8m2fFw3y5H+b ANkpkLv/zM6YCPvGuT4wMvnVu9Zy9r0swEihOQwHjRZESL4iqx19omfvWw== X-Received: by 2002:a17:90b:2e4f:b0:2fe:b8ba:62e1 with SMTP id 98e67ed59e1d1-303a85c5c7amr6127115a91.28.1743085078922; Thu, 27 Mar 2025 07:17:58 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:348b:45ca:56d5:ae1a:bc2b]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3039dfd3868sm2235790a91.1.2025.03.27.07.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Mar 2025 07:17:58 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Carlos O'Donell , =?utf-8?q?Cristian_Rodr=C3=ADguez?= Subject: [PATCH v2] stdlib: Consolidate getentropy and adapt to POSIX 2024 semantics Date: Thu, 27 Mar 2025 11:16:30 -0300 Message-ID: <20250327141754.362790-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: 1. Buffer larger than 256 (GETENTROPY_MAX) should return EINVAL insted of EIO. 2. There is no defined error if no entropy could be obtained. It means that the function should not fail. For change 1. a new compat symbol is added to return EIO for large buffer, while for 2. both old and new symbol will abort the process. Running an older application on a newer glibc should bring about the security benefits of the new glibc, and recent kernels on most architecture do ensure that getrandom will always return at least 256 bytes of entropy (there are projects like Haveged for the case where kernel can not provide such guarantee). This patch does not move getentropy definition to unistd.h not 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. --- Changes from v1: * Added a compat symbol to handle the EIO->EINVAL change. * Move getentropy tests from tst-getrandom.c to tst-getentropy.c and added a compat test. --- NEWS | 4 +- manual/crypt.texi | 2 +- stdlib/Makefile | 8 ++ stdlib/Versions | 3 + stdlib/getentropy.c | 68 ++++++++++- 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, 246 insertions(+), 203 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 c2a978b460..43893e6d5a 100644 --- a/NEWS +++ b/NEWS @@ -20,7 +20,9 @@ Major new features: Deprecated and removed features, and other changes affecting compatibility: - [Add deprecations, removals and changes affecting compatibility here] +* The getentropy function now follows POSIX 2024, which means that + unsupportd large buffer will return EINVAL and the function will + abort the process if there is no entropy available in the system. Changes to build and runtime requirements: 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 c9c8f702a2..6a5a2f610d 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -281,6 +281,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 \ @@ -392,6 +393,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 ea2265bbd4..9b5e186db0 100644 --- a/stdlib/Versions +++ b/stdlib/Versions @@ -223,6 +223,9 @@ libc { stdc_bit_ceil_ul; stdc_bit_ceil_ull; } + GLIBC_2.42 { + getentropy; + } GLIBC_PRIVATE { # functions which have an additional interface since they are # are cancelable. diff --git a/stdlib/getentropy.c b/stdlib/getentropy.c index 5149fbdde0..f55cf879a7 100644 --- a/stdlib/getentropy.c +++ b/stdlib/getentropy.c @@ -16,16 +16,72 @@ License along with the GNU C Library; if not, see . */ -#include +#include #include +#include +#include +#include + +static void +getentropy_fatal (void) +{ + __libc_fatal ("Fatal glibc error: cannot get entropy for getentropy\n"); +} /* 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) + { + switch (errno) + { + case EINTR: + continue; + case ENOSYS: + return -1; + default: + getentropy_fatal (); + } + } + else if (bytes == 0) + /* No more bytes available. This should not happen under normal + circumstances. */ + getentropy_fatal (); + + /* 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 0b963dc890..eb27e2375b 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 b9e9349b9d..e665e2d3c5 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 41f8f39911..bed8fa4b22 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2752,4 +2752,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 34efc96781..a013ea0a28 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.5 __readlinkat_chk F GLIBC_2.5 inet6_opt_append F diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist index de7c618d28..0761a2384a 100644 --- a/sysdeps/unix/sysv/linux/arc/libc.abilist +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist @@ -2513,4 +2513,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist index 96f0314b16..064a6e68ad 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.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 635468fa13..24439791d2 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.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 490694ddce..6abf9beb5e 100644 --- a/sysdeps/unix/sysv/linux/csky/libc.abilist +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist @@ -2789,4 +2789,5 @@ 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 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 b1905da767..f76104d173 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.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 424ef34a8b..e2d0dc47b1 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.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 420471eb24..602cd69707 100644 --- a/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist +++ b/sysdeps/unix/sysv/linux/loongarch/lp64/libc.abilist @@ -2273,4 +2273,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 95a68c7cc1..935efc7a53 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.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 442e82b6d2..7280be509a 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.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 20f7712988..d6192e448b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist @@ -2838,4 +2838,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist index f61ed3bf26..dd691240f8 100644 --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist @@ -2835,4 +2835,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 381120cc16..c721fe6050 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.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 e6071be2ae..11f7928eed 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.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 f41e209a2b..5eff7490ad 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.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 bbcdb31f09..9eb9986e78 100644 --- a/sysdeps/unix/sysv/linux/or1k/libc.abilist +++ b/sysdeps/unix/sysv/linux/or1k/libc.abilist @@ -2263,4 +2263,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index e0ea22b9c6..09a5911d17 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.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 16b9a771f1..30f941b6f5 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.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 070f6f5a08..ee105dd5b0 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.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 4378d1d922..9fc6e44249 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist @@ -2972,4 +2972,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist index 48c6e269a5..958160f764 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist @@ -2516,4 +2516,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index a8b0c6aca7..6db17524b2 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2716,4 +2716,5 @@ 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 diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index 6c00b8440b..0c3ab7b23a 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.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 f866e5d6f3..3d7e3a311e 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.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 4f2db8cb9b..e9d3441e20 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.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 a73473ee32..1992a68b75 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.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 dc7e27db2a..6f4ffa5622 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.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 2ee97f42fb..5f1285bb75 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.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 a7ada1ea53..e025767bc2 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.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 f41ab77c1e..54e76db679 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2767,4 +2767,5 @@ 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