Commit 79a00a10 authored by Jann Horn's avatar Jann Horn Committed by Zheng Zengkai
Browse files

selftests/seccomp: Don't call read() on TTY from background pgrp

stable inclusion
from stable-v5.10.115
commit 5bf2a45e33438d18ff7153a635ec5fc3577f79da
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5IZ9C

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5bf2a45e33438d18ff7153a635ec5fc3577f79da



--------------------------------

commit 2bfed7d2 upstream.

Since commit 92d25637 ("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: 92d25637 ("kselftest: signal all child processes")
Signed-off-by: default avatarJann Horn <jannh@google.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220319010011.1374622-1-jannh@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 0f05e2a8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment