]> git.baikalelectronics.ru Git - kernel.git/commitdiff
signal: don't allow sending any signals to PF_IO_WORKER threads
authorJens Axboe <axboe@kernel.dk>
Sat, 20 Mar 2021 01:25:13 +0000 (19:25 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 21 Mar 2021 15:39:32 +0000 (09:39 -0600)
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>
kernel/signal.c

index ba4d1ef39a9ead9847985954c8edb3629114eb6d..11cabcf20e7a6b18fb8917c59b74b305862a9761 100644 (file)
@@ -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;