selftests/exec: Verify execve of non-regular files fail
authorKees Cook <keescook@chromium.org>
Mon, 18 May 2020 04:47:43 +0000 (21:47 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 22 May 2020 15:29:00 +0000 (09:29 -0600)
commit61016db15b8e20f371352db6a75b044ec3183fe7
treee165fec62302f9fd5d2d7f0d23196b50b6fdcf3e
parenta5f304670b80973dfce5bc86cacff20244926cf6
selftests/exec: Verify execve of non-regular files fail

Add a named pipe as an exec target to make sure that non-regular
files are rejected by execve() with EACCES. This can help verify
commit 73601ea5b7b1 ("fs/open.c: allow opening only regular files
during execve()").

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/exec/.gitignore
tools/testing/selftests/exec/Makefile
tools/testing/selftests/exec/execveat.c