From: Trond Myklebust Date: Fri, 28 Mar 2025 16:52:52 +0000 (-0400) Subject: SUNRPC: Don't allow waiting for exiting tasks X-Git-Tag: v6.15-rc1~50^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14e41b16e8cb677bb440dca2edba8b041646c742;p=thirdparty%2Fkernel%2Flinux.git SUNRPC: Don't allow waiting for exiting tasks Once a task calls exit_signals() it can no longer be signalled. So do not allow it to do killable waits. Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 9b45fbdc90cab..73bc39281ef5f 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -276,6 +276,8 @@ EXPORT_SYMBOL_GPL(rpc_destroy_wait_queue); static int rpc_wait_bit_killable(struct wait_bit_key *key, int mode) { + if (unlikely(current->flags & PF_EXITING)) + return -EINTR; schedule(); if (signal_pending_state(mode, current)) return -ERESTARTSYS;