public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] signal: use task parameter instead of current in task_join_group_stop()
@ 2026-03-15 15:18 Josh Law
  2026-03-15 19:29 ` Oleg Nesterov
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Law @ 2026-03-15 15:18 UTC (permalink / raw)
  To: Oleg Nesterov, Christian Brauner, Andrew Morton
  Cc: Thomas Gleixner, Peter Zijlstra, linux-kernel, Josh Law

task_join_group_stop() takes a task_struct parameter but reads jobctl
and signal from current instead.  This works today because the sole
caller (copy_process) always passes a new thread in the same thread
group as current, so task->signal == current->signal and
task->jobctl is a copy of current->jobctl from dup_task_struct().

Use the task parameter directly so the function is self-consistent
with its API and will not silently break if a future caller passes a
task from a different thread group.

Signed-off-by: Josh Law <objecting@objecting.org>
---
 kernel/signal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 116cf678c4a3..cb417e3674ed 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -386,8 +386,8 @@ static bool task_participate_group_stop(struct task_struct *task)
 
 void task_join_group_stop(struct task_struct *task)
 {
-	unsigned long mask = current->jobctl & JOBCTL_STOP_SIGMASK;
-	struct signal_struct *sig = current->signal;
+	unsigned long mask = task->jobctl & JOBCTL_STOP_SIGMASK;
+	struct signal_struct *sig = task->signal;
 
 	if (sig->group_stop_count) {
 		sig->group_stop_count++;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-15 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-15 15:18 [PATCH] signal: use task parameter instead of current in task_join_group_stop() Josh Law
2026-03-15 19:29 ` Oleg Nesterov
2026-03-15 19:50   ` Josh Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox