From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 715301F4B4 for ; Mon, 12 Apr 2021 10:26:48 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6DEA73896C16; Mon, 12 Apr 2021 10:26:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DEA73896C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1618223206; bh=uT1RHbaiGOtx1asukswUkVayB4Cn6bzHySDZ4dQ9pXQ=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iEYfGsJyNR5BKelh9rcFxTbu3HA6IgaVDoRvvpmCtdzAapL9UBTCaB/3hmVYXiXW8 SUW2RzEDHxCovXJHxqQ1y+rQZscS9IxWZIyx0XvWNbUNXAZKKIncePLMWRIyK+q+cu 4mYniHDIPvThyVTg5DvSnFm7PeZ3eZU18FEkzzqQ= Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id 93A48388A031 for ; Mon, 12 Apr 2021 10:26:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 93A48388A031 Received: by mail-oi1-x22e.google.com with SMTP id j24so2068708oii.11 for ; Mon, 12 Apr 2021 03:26:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:content-transfer-encoding; bh=uT1RHbaiGOtx1asukswUkVayB4Cn6bzHySDZ4dQ9pXQ=; b=fMBMQ1ny2MNRaqAUpEz9aoxTWp0zQA1WJru2hE3IMDzohX9rqcT1SuwMtMBOjPNAIG D+ojpjMwVOzDNP4Qa5oF+AgmoiCjAbG7RGGIcHpC/60iJCXSUzTVFzg+GrFY9Wz/UA4l HoPfRePqZChJHzzyESQDF+t1YQge8Vs1fdGK5IHZY6puuorXjUH9YaYAaAspE78BapxW c//Ebsyr5R0tvM1GrrKjJTZIhIEOXQx0mP+fH6vPv36DOIUKMMIobPCMLMhU20djmbFX q0t31uyVhKry/o2750r0Y9UQTsCQzbuD9qWanms53vzWFFeuhdD/YHVjAll+hd+np7rl oZ7Q== X-Gm-Message-State: AOAM533AO31SokWZUvSAF5zjStkrm6N9C+y/MyuiKHFZn9cEQG6ZJaj0 1kqBrFVCjQRueqRrvtLtLjjVu8asFKgcCf408YXQr7rVMuk= X-Google-Smtp-Source: ABdhPJxVAJvfAfRWlkuCTKbdm/Y3EWj3y7SdzKoxxOISLYP4FBqTne+CUQtHNSeh4b7p3hqVW5+Kr0+rlAAB+vI5CLQ= X-Received: by 2002:aca:dd86:: with SMTP id u128mr18750066oig.155.1618223199475; Mon, 12 Apr 2021 03:26:39 -0700 (PDT) MIME-Version: 1.0 References: <20200428122019.26826-1-ahajkova@redhat.com> <20210405163228.2431406-1-ahajkova@redhat.com> In-Reply-To: <20210405163228.2431406-1-ahajkova@redhat.com> Date: Mon, 12 Apr 2021 12:26:27 +0200 Message-ID: Subject: Re: [PATCH] Linux: Add execveat system call wrapper To: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: =?utf-8?q?Alexandra_H=C3=A1jkov=C3=A1_via_Libc-alpha?= Reply-To: alexandra.khirnova@gmail.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" ping On Mon, Apr 5, 2021 at 6:32 PM Alexandra H=C3=A1jkov=C3=A1 wrote: > > From: Alexandra H=C3=A1jkov=C3=A1 > > Also add the test for the new wrapper. > --- > This version: > * adds attribute_hidden to the unistd.h declaration > * removes the prototype declaration in tst-execveat-compat.c > * moves tst-execveat-compat.c to /sysdeps/unix/sysv/linux > * logs a failure for !WIFEXITED (status) in tst-execveat.c > * makes some cosmetic changes such as changing indentation and such > * adds execveat symbol to sysdeps/unix/sysv/linux/arc/libc.abilist > * and sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist > > NEWS | 5 + > include/unistd.h | 4 + > posix/Makefile | 5 +- > posix/Versions | 3 + > posix/execveat.c | 41 ++++ > posix/tst-execveat.c | 183 ++++++++++++++++++ > posix/unistd.h | 5 + > sysdeps/mach/hurd/i386/libc.abilist | 1 + > sysdeps/unix/sysv/linux/Makefile | 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/execveat.c | 54 ++++++ > sysdeps/unix/sysv/linux/execveat_fallback.c | 69 +++++++ > sysdeps/unix/sysv/linux/hppa/libc.abilist | 1 + > sysdeps/unix/sysv/linux/i386/libc.abilist | 1 + > sysdeps/unix/sysv/linux/ia64/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/mips32/nofpu/libc.abilist | 1 + > .../sysv/linux/mips/mips64/n32/libc.abilist | 1 + > .../sysv/linux/mips/mips64/n64/libc.abilist | 1 + > sysdeps/unix/sysv/linux/nios2/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 + > sysdeps/unix/sysv/linux/tst-execveat-compat.c | 28 +++ > .../unix/sysv/linux/x86_64/64/libc.abilist | 1 + > .../unix/sysv/linux/x86_64/x32/libc.abilist | 1 + > 44 files changed, 429 insertions(+), 2 deletions(-) > create mode 100644 posix/execveat.c > create mode 100644 posix/tst-execveat.c > create mode 100644 sysdeps/unix/sysv/linux/execveat.c > create mode 100644 sysdeps/unix/sysv/linux/execveat_fallback.c > create mode 100644 sysdeps/unix/sysv/linux/tst-execveat-compat.c > > diff --git a/NEWS b/NEWS > index aa0f10a891..a61071b494 100644 > --- a/NEWS > +++ b/NEWS > @@ -18,6 +18,11 @@ Major new features: > a dump of information related to IFUNC resolver operation and > glibc-hwcaps subdirectory selection. > > > [Add deprecations, removals and changes affecting compatibility here] > diff --git a/include/unistd.h b/include/unistd.h > index 1363976161..d694563837 100644 > --- a/include/unistd.h > +++ b/include/unistd.h > @@ -191,6 +191,10 @@ extern int __libc_pause (void); > extern int __getlogin_r_loginuid (char *name, size_t namesize) > attribute_hidden; > > +extern int > +__execveat_fallback (int dirfd, const char *path, char *const argv[], > + char *const envp[], int flags) attribute_hidden; > + > # if IS_IN (rtld) > # include > # endif > diff --git a/posix/Makefile b/posix/Makefile > index be0c72f0bb..4968affaf9 100644 > --- a/posix/Makefile > +++ b/posix/Makefile > @@ -66,7 +66,8 @@ routines :=3D = \ > posix_madvise = \ > get_child_max sched_cpucount sched_cpualloc sched_cpufree \ > streams-compat \ > - shm-directory > + shm-directory = \ > + execveat > > aux :=3D init-posix environ > tests :=3D test-errno tstgetopt testfnm runtests runptests \ > @@ -103,7 +104,7 @@ tests :=3D test-errno tstgetopt testfnm= runtests runptests \ > tst-sysconf-empty-chroot tst-glob_symlinks tst-fexecve= \ > tst-glob-tilde test-ssize-max tst-spawn4 bug-regex37 \ > bug-regex38 tst-regcomp-truncated tst-spawn-chdir \ > - tst-wordexp-nocmd > + tst-wordexp-nocmd tst-execveat > > # Test for the glob symbol version that was replaced in glibc 2.27. > ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes) > diff --git a/posix/Versions b/posix/Versions > index cfd3819966..b77e251e00 100644 > --- a/posix/Versions > +++ b/posix/Versions > @@ -147,6 +147,9 @@ libc { > } > GLIBC_2.30 { > } > + GLIBC_2.34 { > + execveat; > + } > GLIBC_PRIVATE { > __libc_fork; __libc_pread; __libc_pwrite; > __nanosleep_nocancel; __pause_nocancel; > diff --git a/posix/execveat.c b/posix/execveat.c > new file mode 100644 > index 0000000000..3f0d0820e7 > --- /dev/null > +++ b/posix/execveat.c > @@ -0,0 +1,41 @@ > +/* Execute program relative to a directory file descriptor. > + Copyright (C) 2021 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 > + > +/* Replace the current process, executing PATH relative to DIFRD with > + * arguments ARGV and environment ENVP. > + * ARGV and ENVP are terminated by NULL pointers. */ > +int > +__execveat (int dirfd, const char *path, char *const argv[], char *const= envp[], > + int flags) > +{ > + if (path =3D=3D NULL || argv =3D=3D NULL || envp =3D=3D NULL) > + { > + __set_errno (EINVAL); > + return -1; > + } > + > + __set_errno (ENOSYS); > + return -1; > +} > +stub_warning (execveat) > + > +weak_alias (__execveat, execveat) > diff --git a/posix/tst-execveat.c b/posix/tst-execveat.c > new file mode 100644 > index 0000000000..186134564f > --- /dev/null > +++ b/posix/tst-execveat.c > @@ -0,0 +1,183 @@ > +/* Test execveat at the various corner cases. > + Copyright (C) 2021 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +int > +call_execveat (int fd, const char *pathname, int flags, int expected_fai= l, > + int num) > +{ > + char *envp[] =3D { (char *) "FOO=3D3", NULL }; > + char *argv[] =3D { (char *) "sh", (char *) "-c", (char *) "exit $FOO",= NULL }; > + pid_t pid; > + int status; > + > + if (test_verbose > 0) > + printf ("call line number: %d\n", num); > + > + pid =3D xfork (); > + if (pid =3D=3D 0) > + { > + TEST_COMPARE (execveat (fd, pathname, argv, envp, flags), -1); > + if (errno =3D=3D ENOSYS) > + FAIL_UNSUPPORTED ("execveat is unimplemented"); > + else if (errno =3D=3D expected_fail) > + { > + if (test_verbose > 0) > + printf ("expected fail: errno %d\n", errno); > + _exit (0); > + } > + else > + FAIL_EXIT1 ("execveat failed: %m (%d)", errno); > + } > + xwaitpid (pid, &status, 0); > + > + if (!WIFEXITED (status)) > + FAIL_RET ("child hasn't exited normally"); > + > + if (WIFEXITED (status)) > + { > + if (WEXITSTATUS (status) =3D=3D EXIT_UNSUPPORTED) > + FAIL_UNSUPPORTED ("execveat is unimplemented"); > + else if (expected_fail !=3D 0) > + TEST_COMPARE (WEXITSTATUS (status), 0); > + else > + TEST_COMPARE (WEXITSTATUS (status), 3); > + } > + return 0; > +} > + > +static int > +do_test (void) > +{ > + DIR *dirp; > + int fd, fd_out; > + char *tmp_dir, *symlink_name, *tmp_sh; > + struct stat64 st; > + > + dirp =3D opendir ("/bin"); > + if (dirp =3D=3D NULL) > + FAIL_EXIT1 ("failed to open /bin"); > + fd =3D dirfd (dirp); > + > + /* Call execveat for various fd/pathname combinations. */ > + > + /* Check the pathname relative to a valid dirfd. */ > + call_execveat (fd, "sh", 0, 0, __LINE__); > + xchdir ("/bin"); > + /* Use the special value AT_FDCWD as dirfd. Quoting open(2): > + If pathname is relative and dirfd is the special value AT_FDCWD, th= en > + pathname is interpreted relative to the current working directory o= f > + the calling process. */ > + call_execveat (AT_FDCWD, "sh", 0, 0, __LINE__); > + xclose (fd); > +#ifdef O_PATH > + /* Check the pathname relative to a valid dirfd with O_PATH. */ > + fd =3D xopen ("/bin", O_PATH | O_DIRECTORY, O_RDONLY); > + call_execveat (fd, "sh", 0, 0, __LINE__); > + xclose (fd); > + > + /* Check absolute pathname, dirfd should be ignored. */ > + call_execveat (AT_FDCWD, "/bin/sh", 0, 0, __LINE__); > + fd =3D xopen ("/usr", O_PATH | O_DIRECTORY, 0); > + /* Same check for absolute pathname, but with input file descriptor > + openend with different flags. The dirfd should be ignored. */ > + call_execveat (fd, "/bin/sh", 0, 0, __LINE__); > + xclose (fd); > +#endif > + > + fd =3D xopen ("/usr", O_RDONLY, 0); > + /* Same check for absolute pathname, but with input file descriptor > + openend with different flags. The dirfd should be ignored. */ > + call_execveat (fd, "/bin/sh", 0, 0, __LINE__); > + xclose (fd); > + > + fd =3D xopen ("/bin/sh", O_RDONLY, 0); > + /* Check relative pathname, where dirfd does not point to a directory.= */ > + call_execveat (fd, "sh", 0, ENOTDIR, __LINE__); > + /* Check absolute pathname, but dirfd is a regular file. The dirfd > + should be ignored. */ > + call_execveat (fd, "/bin/sh", 0, 0, __LINE__); > + xclose (fd); > + > +#ifdef O_PATH > + /* Quoting open(2): O_PATH > + Obtain a file descriptor that can be used for two purposes: to > + indicate a location in the filesystem tree and to perform > + operations that act purely at the file descriptor level. */ > + fd =3D xopen ("/bin/sh", O_PATH, 0); > + /* Check the empty pathname. Dirfd is a regular file with O_PATH. */ > + call_execveat (fd, "", 0, ENOENT, __LINE__); > + /* Same check for an empty pathname, but with AT_EMPTY_PATH flag. > + Quoting open(2): > + If oldpath is an empty string, create a link to the file referenced > + by olddirfd (which may have been obtained using the open(2) O_PATH = flag. */ > + call_execveat (fd, "", AT_EMPTY_PATH, 0, __LINE__); > + call_execveat (fd, "", AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW, 0, __LINE_= _); > + xclose (fd); > + > + /* Create a temporary directory "tmp_dir" and create a symbolik link t= mp_sh > + pointing to /bin/sh inside the tmp_dir. Open dirfd as a symbolic li= nk. */ > + tmp_dir =3D support_create_temp_directory ("tst-execveat_dir"); > + symlink_name =3D xasprintf ("%s/symlink", tmp_dir); > + xsymlink ("tmp_sh", symlink_name); > + add_temp_file (symlink_name); > + tmp_sh =3D xasprintf ("%s/tmp_sh", tmp_dir); > + add_temp_file (tmp_sh); > + fd_out =3D xopen (symlink_name, O_CREAT | O_WRONLY, 0); > + xstat ("/bin/sh", &st); > + fd =3D xopen ("/bin/sh", O_RDONLY, 0); > + xcopy_file_range (fd, 0, fd_out, 0, st.st_size, 0); > + xfchmod (fd_out, 0700); > + xclose (fd); > + xclose (fd_out); > + fd_out =3D xopen (symlink_name, O_PATH, 0); > + > + /* Check the empty pathname. Dirfd is a symbolic link. */ > + call_execveat (fd_out, "", 0, ENOENT, __LINE__); > + call_execveat (fd_out, "", AT_EMPTY_PATH, 0, __LINE__); > + call_execveat (fd_out, "", AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW, 0, > + __LINE__); > + xclose (fd_out); > + free (symlink_name); > + free (tmp_sh); > + free (tmp_dir); > +#endif > + > + /* Call execveat with closed fd, we expect this to fail with EBADF. *= / > + call_execveat (fd, "sh", 0, EBADF, __LINE__); > + /* Call execveat with closed fd, we expect this to pass because the pa= thname is > + absolute. */ > + call_execveat (fd, "/bin/sh", 0, 0, __LINE__); > + > + return 0; > +} > + > +#include > diff --git a/posix/unistd.h b/posix/unistd.h > index 3f22763379..d9d8929f71 100644 > --- a/posix/unistd.h > +++ b/posix/unistd.h > @@ -295,6 +295,11 @@ extern int euidaccess (const char *__name, int __typ= e) > /* An alias for `euidaccess', used by some other systems. */ > extern int eaccess (const char *__name, int __type) > __THROW __nonnull ((1)); > + > +/* Execute program relative to a directory file descriptor. */ > +extern int execveat (int __fd, const char *__path, char *const __argv[], > + char *const __envp[], int __flags) > + __THROW __nonnull ((2, 3)); > #endif > > #ifdef __USE_ATFILE > diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386= /libc.abilist > index 7424dc9166..bb2fe83e21 100644 > --- a/sysdeps/mach/hurd/i386/libc.abilist > +++ b/sysdeps/mach/hurd/i386/libc.abilist > @@ -2206,6 +2206,7 @@ GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __isnanf128 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > GLIBC_2.4 __fgets_unlocked_chk F > diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/M= akefile > index 303fa297bc..36bc188b55 100644 > --- a/sysdeps/unix/sysv/linux/Makefile > +++ b/sysdeps/unix/sysv/linux/Makefile > @@ -117,6 +117,7 @@ tests +=3D tst-ofdlocks-compat > endif > > tests-internal +=3D tst-sigcontext-get_pc > +tests-static-internal +=3D tst-execveat-compat > > CFLAGS-tst-sigcontext-get_pc.c =3D -fasynchronous-unwind-tables > > diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/= sysv/linux/aarch64/libc.abilist > index 851f15a566..132589648e 100644 > --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist > @@ -2174,4 +2174,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sy= sv/linux/alpha/libc.abilist > index 33b426ef20..891e20f5e6 100644 > --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist > +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist > @@ -2263,6 +2263,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv= /linux/arc/libc.abilist > index c09947ad58..d86333c354 100644 > --- a/sysdeps/unix/sysv/linux/arc/libc.abilist > +++ b/sysdeps/unix/sysv/linux/arc/libc.abilist > @@ -1933,4 +1933,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/s= ysv/linux/arm/be/libc.abilist > index 57be971f81..78d7d19f79 100644 > --- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist > +++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist > @@ -156,6 +156,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _Exit F > GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 > diff --git a/sysdeps/unix/sysv/linux/arm/le/libc.abilist b/sysdeps/unix/s= ysv/linux/arm/le/libc.abilist > index 2db02fae07..4242914991 100644 > --- a/sysdeps/unix/sysv/linux/arm/le/libc.abilist > +++ b/sysdeps/unix/sysv/linux/arm/le/libc.abilist > @@ -153,6 +153,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _Exit F > GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 > diff --git a/sysdeps/unix/sysv/linux/csky/libc.abilist b/sysdeps/unix/sys= v/linux/csky/libc.abilist > index 0dd3527892..e6d2a4f09b 100644 > --- a/sysdeps/unix/sysv/linux/csky/libc.abilist > +++ b/sysdeps/unix/sysv/linux/csky/libc.abilist > @@ -2117,4 +2117,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/execveat.c b/sysdeps/unix/sysv/linux= /execveat.c > new file mode 100644 > index 0000000000..9deab0a2b4 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/execveat.c > @@ -0,0 +1,55 @@ > +/* Execute program relative to a directory file descriptor. > + Copyright (C) 2021 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 > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +#ifndef __ASSUME_EXECVEAT > +# include "execveat_fallback.c" > +#endif > + > +/* Execute the file FD refers to, overlaying the running program image. > + ARGV and ENVP are passed to the new program, as for `execve'. */ > +int > +execveat (int dirfd, const char *path, char *const argv[], char *const e= nvp[], > + int flags) > +{ > + /* Avoid implicit array coercion in syscall macros. */ > + INLINE_SYSCALL_CALL (execveat, dirfd, path, &argv[0], &envp[0], flag= s); > +#ifndef __ASSUME_EXECVEAT > + if (errno !=3D ENOSYS) > + return -1; > + > + if ((flags & ~(AT_EMPTY_PATH | AT_SYMLINK_NOFOLLOW)) !=3D 0) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); > + > + return __execveat_fallback (dirfd, path, argv, envp, flags); > +#endif > + > + return -1; > +} > diff --git a/sysdeps/unix/sysv/linux/execveat_fallback.c b/sysdeps/unix/s= ysv/linux/execveat_fallback.c > new file mode 100644 > index 0000000000..6249c76079 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/execveat_fallback.c > @@ -0,0 +1,69 @@ > +/* Execute program relative to a directory file descriptor. > + Copyright (C) 2021 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 > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +int > +__execveat_fallback (int dirfd, const char *path, char *const argv[], > + char *const envp[], int flags) > +{ > + int fd; > + > + if (path[0] =3D=3D '\0' && (flags & AT_EMPTY_PATH) && dirfd >=3D 0) > + fd =3D dirfd; > + else > + { > + int oflags =3D O_CLOEXEC; > + if (flags & AT_SYMLINK_NOFOLLOW) > + oflags |=3D O_NOFOLLOW; > + fd =3D __openat_nocancel (dirfd, path, oflags); > + } > + if (fd < 0) > + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EBADFD); > + > + struct fd_to_filename fdfilename; > + const char *gfilename =3D __fd_to_filename (fd, &fdfilename); > + > + /* We do not need the return value. */ > + __execve (gfilename, argv, envp); > + > + int save =3D errno; > + > + /* We come here only if the 'execve' call fails. Determine whether > + /proc is mounted. If not we return ENOSYS. */ > + struct stat64 st; > + if (__stat64 (FD_TO_FILENAME_PREFIX, &st) !=3D 0 && errno =3D=3D ENOEN= T) > + save =3D ENOSYS; > + > + if (fd !=3D dirfd) > + __close_nocancel_nostatus (fd); > + __set_errno (save); > + > + return -1; > +} > diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sys= v/linux/hppa/libc.abilist > index 04c32f9b65..aebcb2cda5 100644 > --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist > +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist > @@ -2076,6 +2076,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sys= v/linux/i386/libc.abilist > index cfd4e55e57..026dc67c14 100644 > --- a/sysdeps/unix/sysv/linux/i386/libc.abilist > +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist > @@ -2253,6 +2253,7 @@ GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __isnanf128 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sys= v/linux/ia64/libc.abilist > index 426e15f4f6..2c2c16e9e1 100644 > --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist > @@ -2110,6 +2110,7 @@ GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __isnanf128 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps= /unix/sysv/linux/m68k/coldfire/libc.abilist > index bdecf60fae..7a00dd7869 100644 > --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist > +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist > @@ -157,6 +157,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _Exit F > GLIBC_2.4 _IO_2_1_stderr_ D 0x98 > diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/u= nix/sysv/linux/m68k/m680x0/libc.abilist > index eaa5a97a61..a1fdc560a5 100644 > --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist > +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist > @@ -2196,6 +2196,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist b/sysdeps= /unix/sysv/linux/microblaze/be/libc.abilist > index 571315511b..c5ab412504 100644 > --- a/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist > +++ b/sysdeps/unix/sysv/linux/microblaze/be/libc.abilist > @@ -2168,4 +2168,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist b/sysdeps= /unix/sysv/linux/microblaze/le/libc.abilist > index 9d4c1f53f7..d4e9ff1675 100644 > --- a/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist > +++ b/sysdeps/unix/sysv/linux/microblaze/le/libc.abilist > @@ -2165,4 +2165,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysde= ps/unix/sysv/linux/mips/mips32/fpu/libc.abilist > index 6de58a4680..4d9dbb3901 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist > +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist > @@ -2159,6 +2159,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sys= deps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist > index e1c971c361..488f2aa6de 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist > +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist > @@ -2157,6 +2157,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysde= ps/unix/sysv/linux/mips/mips64/n32/libc.abilist > index 28d6d3284d..bac10468b7 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist > @@ -2165,6 +2165,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysde= ps/unix/sysv/linux/mips/mips64/n64/libc.abilist > index 3060a503ab..95200c2064 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist > @@ -2159,6 +2159,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sy= sv/linux/nios2/libc.abilist > index 24e0a6f16a..b5b3bc7bd4 100644 > --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist > +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist > @@ -2207,4 +2207,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b= /sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist > index b9cccc3fe5..38e4e3cb21 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist > @@ -2223,6 +2223,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist= b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist > index 5c81a23740..41b4abd7ef 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist > @@ -2256,6 +2256,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist b/= sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist > index a61d2502d5..7ea617f84f 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist > @@ -2078,6 +2078,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist b/= sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist > index ec9ae25539..6b3de81190 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist > @@ -2370,4 +2370,5 @@ GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __isnanf128 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist b/sysdeps/un= ix/sysv/linux/riscv/rv32/libc.abilist > index b08ece30b8..ff85889ea1 100644 > --- a/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist > +++ b/sysdeps/unix/sysv/linux/riscv/rv32/libc.abilist > @@ -1935,4 +1935,5 @@ GLIBC_2.33 write F > GLIBC_2.33 writev F > GLIBC_2.33 wscanf F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/un= ix/sysv/linux/riscv/rv64/libc.abilist > index 12ced01cf7..f18bc160c4 100644 > --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist > @@ -2135,4 +2135,5 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/= unix/sysv/linux/s390/s390-32/libc.abilist > index 7ed5e4c515..eb80905f99 100644 > --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist > +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist > @@ -2221,6 +2221,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/= unix/sysv/linux/s390/s390-64/libc.abilist > index 73a46b01b2..360817ff74 100644 > --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist > @@ -2114,6 +2114,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/sh/be/libc.abilist b/sysdeps/unix/sy= sv/linux/sh/be/libc.abilist > index 2aa68f1def..535b0a329b 100644 > --- a/sysdeps/unix/sysv/linux/sh/be/libc.abilist > +++ b/sysdeps/unix/sysv/linux/sh/be/libc.abilist > @@ -2083,6 +2083,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/sh/le/libc.abilist b/sysdeps/unix/sy= sv/linux/sh/le/libc.abilist > index 07f3c23873..82ee8a8203 100644 > --- a/sysdeps/unix/sysv/linux/sh/le/libc.abilist > +++ b/sysdeps/unix/sysv/linux/sh/le/libc.abilist > @@ -2080,6 +2080,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps= /unix/sysv/linux/sparc/sparc32/libc.abilist > index cc1d278c72..af3be1fd59 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist > @@ -2212,6 +2212,7 @@ GLIBC_2.33 mknodat F > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps= /unix/sysv/linux/sparc/sparc32/libc.abilist > index cc1d278c72..af3be1fd59 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist > +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist > @@ -2212,6 +2212,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 _IO_fprintf F > GLIBC_2.4 _IO_printf F > diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps= /unix/sysv/linux/sparc/sparc64/libc.abilist > index 79ca3d5d9c..8b41b11497 100644 > --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist > @@ -2131,6 +2131,7 @@ GLIBC_2.33 mknodat F > GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/tst-execveat-compat.c b/sysdeps/unix= /sysv/linux/tst-execveat-compat.c > new file mode 100644 > index 0000000000..a0ba77bb1d > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/tst-execveat-compat.c > @@ -0,0 +1,28 @@ > +/* Test the fallback implementation of execveat. > + Copyright (C) 2021 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 > + . */ > + > +/* Get the declaration of the official execveat function. */ > +#include > + > +/* Compile a local version of execveat. */ > +#include > + > +/* Re-use the test, but run it against copy_file_range_compat defined > + above. */ > +#define execveat execveat_fallback > +#include > diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/uni= x/sysv/linux/x86_64/64/libc.abilist > index da0974f11a..3d1089a3e8 100644 > --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist > +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist > @@ -2092,6 +2092,7 @@ GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __isnanf128 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > GLIBC_2.4 __confstr_chk F > GLIBC_2.4 __fgets_chk F > diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/un= ix/sysv/linux/x86_64/x32/libc.abilist > index d3d155e7c0..593beb66d9 100644 > --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist > +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist > @@ -2189,4 +2189,5 @@ GLIBC_2.33 stat F > GLIBC_2.33 stat64 F > GLIBC_2.34 __isnanf128 F > GLIBC_2.34 __libc_start_main F > +GLIBC_2.34 execveat F > GLIBC_2.34 pthread_kill F > -- > 2.26.3 >