selftests/timens: add a test for vfork+exit
authorAndrei Vagin <avagin@gmail.com>
Thu, 13 Oct 2022 17:31:54 +0000 (10:31 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 25 Oct 2022 22:15:52 +0000 (15:15 -0700)
commitaf4fddffbe95855ef3b413158fa8e6e95899f2b2
treebc01dfc41b8289f4365b9d9ef40880225c77ba9d
parent2b5f9dad32ed19e8db3b0f10a84aa824a219803b
selftests/timens: add a test for vfork+exit

* check that a child process is in parent's time namespace after vfork.
* check that a child process is in the target namespace after exec.

Output on success:
 1..4
 ok 1 parent before vfork
 ok 2 child after exec
 ok 3 wait for child
 ok 4 parent after vfork
 # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:0 error:0

Signed-off-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221013173154.291597-1-avagin@google.com
tools/testing/selftests/timens/.gitignore
tools/testing/selftests/timens/Makefile
tools/testing/selftests/timens/vfork_exec.c [new file with mode: 0644]