aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-03-19 19:25:13 -0600
committerJens Axboe <axboe@kernel.dk>2021-03-21 09:39:32 -0600
commit5be28c8f85ce99ed2d329d2ad8bdd18ea19473a5 (patch)
treea0e1f35dc49381c58cfb40e10d32d14aaf5996ed /kernel/signal.c
parentio_uring: don't leak creds on SQO attach error (diff)
downloadlinux-dev-5be28c8f85ce99ed2d329d2ad8bdd18ea19473a5.tar.xz
linux-dev-5be28c8f85ce99ed2d329d2ad8bdd18ea19473a5.zip
signal: don't allow sending any signals to PF_IO_WORKER threads
They don't take signals individually, and even if they share signals with the parent task, don't allow them to be delivered through the worker thread. Linux does allow this kind of behavior for regular threads, but it's really a compatability thing that we need not care about for the IO threads. Reported-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index ba4d1ef39a9e..11cabcf20e7a 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -833,6 +833,9 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info,
if (!valid_signal(sig))
return -EINVAL;
+ /* PF_IO_WORKER threads don't take any signals */
+ if (t->flags & PF_IO_WORKER)
+ return -ESRCH;
if (!si_fromuser(info))
return 0;