From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender-of-o59.zoho.eu (sender-of-o59.zoho.eu [136.143.169.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2C031A073F for ; Sun, 15 Mar 2026 19:51:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.169.59 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773604282; cv=pass; b=krO4rQqu56bR86iaW/mF2uDhd+R/xrbj9iRi+L4lxlAQ7kZ0Kih5cBf7kFUmwUE1hMDhp3xHSiqqM2w1qFN5OmlsLyLhAwI+oBOZR7frxr8LiKFgG16wAiHX0ICPhSHN2Rjy48XRbaRxoWN+AHenPtIoVxhAeUr8eyW1v/Zp52k= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773604282; c=relaxed/simple; bh=UGeBLOANcIG4iozld6wPfFvEER5Cs50YHsp4AixArtE=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=qE4wkqoO64FhTWYi7h6KRoAabqe/ANN6hfIoAgUWF5GOgx88JCJmjdrAy+zACVWii2Jz/KVHFpP8yWA3UUEfI4zEv+cXb1l8ziDn249PHul0Fr6kTPooEg87uKJ9P0kfdsAysX0TlrDw2sZsdlTxslbeo9+vWfMFVbxPe/eka3g= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org; spf=pass smtp.mailfrom=objecting.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b=od+fi9iZ; arc=pass smtp.client-ip=136.143.169.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=objecting.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=objecting.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=objecting.org header.i=objecting@objecting.org header.b="od+fi9iZ" ARC-Seal: i=1; a=rsa-sha256; t=1773604254; cv=none; d=zohomail.eu; s=zohoarc; b=IHRBYn6fGVu+GjKG+uH4Gd1Bzi3ZbQgMxiYSdmr26Q7/s1fa2yHq2Jdq18Rt07DCjyjE7+JX2V2zdMPp7sf2rPXa3SjLZ3Tb3ZIFpWeCeQtQYU/jl9hbncTeiGeQ/b1s5g8FaikEFZeGWuOwiAHBfOGJKF7VWYv+PGp/v+qWHj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1773604254; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=kgpCbjy6MvsnCm/GQMizolyfdzlZcZHnAvgGs9418To=; b=ZVF5DVEuvhrmPw/zMhFFehAqeSa5rD96FKF3gx+9CwexjE9RijF4KJ4zTjnm0VXGYX3fiQvvq14CyLQrQc0bLDxm/usKCq6Yte78xiLWC0nwBVZyjKlPN7VWedty4q2Vi8mLObArtsAr4HMXTIThnYO/mwXk2n4EEHJeiAlXyKY= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=objecting.org; spf=pass smtp.mailfrom=objecting@objecting.org; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773604254; s=zmail; d=objecting.org; i=objecting@objecting.org; h=Date:Date:From:From:To:To:CC:Subject:Subject:In-Reply-To:References:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=kgpCbjy6MvsnCm/GQMizolyfdzlZcZHnAvgGs9418To=; b=od+fi9iZMP0DinTRasxtIDm9bjTWwhAOZlLXOwySnMWlZaXzwDMTdeEkqsoa/TYO UXhfJiGmPPEhao27Nwdb5uOCF4dsqWg7WudlCd7vV8BnfZZ7ScVmvF8nMPKWhyiE+LF yGgRCPg4U1rKpFPZsOu7wLeIRx5kcpBAO5iaZ47o= Received: by mx.zoho.eu with SMTPS id 1773604253110968.3543431011221; Sun, 15 Mar 2026 20:50:53 +0100 (CET) Date: Sun, 15 Mar 2026 19:50:54 +0000 From: Josh Law To: Oleg Nesterov CC: Christian Brauner , Andrew Morton , Thomas Gleixner , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH=5D_signal=3A_use_task_parameter_in?= =?US-ASCII?Q?stead_of_current_in_task=5Fjoin=5Fgroup=5Fstop=28=29?= User-Agent: Thunderbird for Android In-Reply-To: References: <20260315151847.214634-1-objecting@objecting.org> Message-ID: <7FCB7311-8EA9-437E-AAA6-FFE941719DF8@objecting.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External On 15 March 2026 19:29:06 GMT, Oleg Nesterov wrote: >Hi Josh, > >Well, this is subjective, but I don't like your patch in any case=2E=2E= =2E >In fact I think it is wrong=2E See below=2E > >On 03/15, Josh Law wrote: >> >> task_join_group_stop() takes a task_struct parameter but reads jobctl >> and signal from current instead=2E > >And in my opinion this is what it should actually do=2E > >Because task_join_group_stop(p) asks 'p' to join the current's group-stop >if it is active=2E > >And to me this logic looks very clear=2E but may be task_join_group_stop(= ) >should be renamed to make it even more clear, I dunno=2E > >> This works today because the sole >> caller (copy_process) always passes a new thread in the same thread >> group as current, so task->signal =3D=3D current->signal and >> task->jobctl is a copy of current->jobctl from dup_task_struct()=2E > >I see it differently=2E > >Your change assumes that task->jobctl was correctly copied by dup_task_st= ruct()=2E >We should not rely on that=2E > >And at first glance we can't rely on that=2E current->jobctl can change b= etween between >dup_task_struct() and copy_process() -> spin_lock(¤t->sighand->sigl= ock); > >Oleg=2E > >> 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=2E >>=20 >> Signed-off-by: Josh Law >> --- >> kernel/signal=2Ec | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >>=20 >> diff --git a/kernel/signal=2Ec b/kernel/signal=2Ec >> index 116cf678c4a3=2E=2Ecb417e3674ed 100644 >> --- a/kernel/signal=2Ec >> +++ b/kernel/signal=2Ec >> @@ -386,8 +386,8 @@ static bool task_participate_group_stop(struct task= _struct *task) >> =20 >> void task_join_group_stop(struct task_struct *task) >> { >> - unsigned long mask =3D current->jobctl & JOBCTL_STOP_SIGMASK; >> - struct signal_struct *sig =3D current->signal; >> + unsigned long mask =3D task->jobctl & JOBCTL_STOP_SIGMASK; >> + struct signal_struct *sig =3D task->signal; >> =20 >> if (sig->group_stop_count) { >> sig->group_stop_count++; >> --=20 >> 2=2E34=2E1 >>=20 > Thanks for the review Oleg, and you are right=2E Sorry for the inconvenien= ce=20 V/R Josh Law