[LTP] [PATCH] syscalls/execve06: Add test for argv[0] = NULL

Petr Vorel pvorel@suse.cz
Mon Jun 13 15:51:20 CEST 2022


HI Cyril,

> Adds a test that kernel sets argv[0] to a dummy empty string if NULL was
> passed to the execve() syscall. This was introduced in commit:

> commit dcd46d897adb70d63e025f175a00a89797d31a43
> Author: Kees Cook <keescook@chromium.org>
> Date:   Mon Jan 31 16:09:47 2022 -0800

>     exec: Force single empty string when argv is empty

> in order to fix all potential CVEs where userspace programs attempt to
> blindly process the argv[] list starting at argv[1]. There was at least
> one example of this caught in the wild CVE-2021-4034 in polkit but there
> are likely more.

Great, thanks for addressing this.

> Fixes: #911

>  testcases/kernel/syscalls/execve/.gitignore   |  2 +
>  testcases/kernel/syscalls/execve/execve06.c   | 49 +++++++++++++++++++
>  .../kernel/syscalls/execve/execve06_child.c   | 27 ++++++++++
>  3 files changed, 78 insertions(+)
>  create mode 100644 testcases/kernel/syscalls/execve/execve06.c
>  create mode 100644 testcases/kernel/syscalls/execve/execve06_child.c

This should go to runtest/syscalls and runtest/cve, right?
(can be fixed before merge).

Kind regards,
Petr


More information about the ltp mailing list