]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/seccomp: Don't call read() on TTY from background pgrp
authorJann Horn <jannh@google.com>
Sat, 19 Mar 2022 01:00:11 +0000 (02:00 +0100)
committerKees Cook <keescook@chromium.org>
Fri, 29 Apr 2022 18:28:41 +0000 (11:28 -0700)
commit2727e6d2a5de3e5969bf9504695afc20d8e61386
tree942646132ec42def86ffcd74304105cc7ece7bcd
parentc02c8228f39a35a18b7da5bed4327a96bdd1c782
selftests/seccomp: Don't call read() on TTY from background pgrp

Since commit 2a813feb1e1a ("kselftest: signal all child processes"), tests
are executed in background process groups. This means that trying to read
from stdin now throws SIGTTIN when stdin is a TTY, which breaks some
seccomp selftests that try to use read(0, NULL, 0) as a dummy syscall.

The simplest way to fix that is probably to just use -1 instead of 0 as
the dummy read()'s FD.

Fixes: 2a813feb1e1a ("kselftest: signal all child processes")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220319010011.1374622-1-jannh@google.com
tools/testing/selftests/seccomp/seccomp_bpf.c