[PATCH v2 15/27] BB_EXECVP: make BB_EXECVP do NOEXEC logic and allow it to to force applet execution

David Leonard d+busybox at adaptive-enterprises.com
Wed Jan 22 10:31:43 UTC 2025



On Wed, 22 Jan 2025, Nadav Tasher wrote:

> When FEATURE_FORCE_APPLETS is enabled, BB_EXECVP will
> fail when trying to execute things that are not busybox
> applets. This allows more control over the executed
> processes.
...
> +int FAST_FUNC BB_EXECVPE(const char *file, char *const argv[], char *const envp[])
> +{
> +	clearenv();
> +	while (*envp)
> +		putenv(*envp++);
> +
> +	return BB_EXECVP(file, argv);
> +}

BB_EXECVPE can return an error and leave the environ of the caller altered,
which is a bit different to execvpe(). Maybe it can be switched around so that
BB_EXECVP() calls BB_EXECVPE() with a null envp.

This patchset is a very interesting feature, by the way.


More information about the busybox mailing list