Skip to content

Commit

Permalink
signal: don't allow sending any signals to PF_IO_WORKER threads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jens Axboe committed Mar 21, 2021
1 parent de75a3d commit 5be28c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5be28c8

Please sign in to comment.