]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:23:16 +0000 (14:23 +0200)
commit623845852778c7d46494289fee01ae4c7c706b27
treec357dbccd06f6baf761e077da7d45e2fb779ec9b
parentdd6cf49fa66a0fb875c4bf90d7d530a4f5926508
selftests/seccomp: Don't call read() on TTY from background pgrp

BugLink: https://bugs.launchpad.net/bugs/1978240
commit 2bfed7d2ffa5d86c462d3e2067f2832eaf8c04c7 upstream.

Since commit 92d25637a3a4 ("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: 92d25637a3a4 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/seccomp/seccomp_bpf.c