Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260630200312.GX3520958@port70.net>
Date: Tue, 30 Jun 2026 22:03:12 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: Skye Soss <skye@...s.website>
Cc: musl <musl@...ts.openwall.com>
Subject: Re: [PATCH] add execveat syscall wrapper

* Skye Soss <skye@...s.website> [2026-06-30 14:39:37 -0500]:
> The execveat syscall was added to Linux in v4.0 (released in 2015), 

added in 3.19 (released in 2015) see
linux commit 27d6ec7ad6f7a2a131ff8e9f77bcc6547e178d2c

> and the libc wrapper function was added to glibc in 2021
>  
> The AT_EXECVEAT_CHECK option was added to Linux 6.14, so I believe the 

it's spelled AT_EXECVE_CHECK
you should add it from linux uapi to musl fcntl.h
(AT_ is reserved namespace so no need for _GNU_SOURCE)

> syscall has the potential to become more widely used. Thus it is 
> important for musl to provide the wrapper.
> --- 
>  include/unistd.h       | 1 + 
>  src/process/execveat.c | 7 +++++++ 
>  2 files changed, 8 insertions(+) 
>  create mode 100644 src/process/execveat.c 
>  
> diff --git a/include/unistd.h b/include/unistd.h 
> index 42b0e82b..a4bd6ddd 100644 
> --- a/include/unistd.h 
> +++ b/include/unistd.h 
> @@ -95,6 +95,7 @@ int execvp(const char *, char *const []); 
>  int execlp(const char *, const char *, ...); 
>  int fexecve(int, char *const [], char *const []); 
>  _Noreturn void _exit(int); 
> +int execveat(int, const char *, char *const [], char *const [], int); 

should be under the _GNU_SOURCE section,
this is not a posix api.

>  
>  pid_t getpid(void); 
>  pid_t getppid(void); 
> diff --git a/src/process/execveat.c b/src/process/execveat.c 
> new file mode 100644 
> index 00000000..a9d12877 
> --- /dev/null 
> +++ b/src/process/execveat.c 
> @@ -0,0 +1,7 @@ 
> +#include <unistd.h> 
> +#include "syscall.h" 
> + 
> +int execveat(int dirfd, const char *path, char *const argv[], char *const envp[], int flags) 
> +{ 
> +    return syscall(SYS_execveat, dirfd, path, argv, envp, flags); 
> +} 
> -- 
> 2.54.0
> 

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.