From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 42B5531D375 for ; Mon, 24 Aug 2026 12:11:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787573515; cv=none; b=AouADwiJF7iGGst4/3nzIdBetZqF4jsahZwR7GmaYLjw3UYqBr4xM2vfowY8QdW5+gK/y6vMEVMQV+vFmahMsegMfd74BHSjC9TVzYnYZqpc0+VWHEYTBdHxvaKkNGOZqR1j0t/cILZU/+DoGHmzwVI2J5oyLJb1J58Dau6bTfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787573515; c=relaxed/simple; bh=nUyjMqHsEJl+5w+ru+f2rYQRIfSzksMDHLo4Z8+mZ48=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=B/CdmPa2ekQyVhE/O/VLllcMkCApPtEoy8ayraRhHqmv3wk6F9oBbqaoq9T4Fp6dUuMfD455bd9OLBBlXzLEB/vRtkgBvfuMFKdrcbY1pEjIi1ywwhCsL94B7HcfuLd8xZkzHaI684ZgYB3DUMwjBIdp+Ixi8rEWNbuxax+vDy4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=amUTJXab; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="amUTJXab" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A5471F000E9; Mon, 24 Aug 2026 12:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787573513; bh=LfvE7NwyD14JCU0C+dIlcvPptC98oQ4Oey3U4bye3fk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=amUTJXabfbwUjS9EznElo9O1BEoTcrUsXEq4fgufEAOw0Q9VI6PHMdPVx1kwYCW9t VyX5UzqNHky2u1QBFV9Mmx6N1xNa1AhcwLWl1H4oz/4z7HvQPbKG0+CzB/rzRvHJ73 E5CMM2Z/NHZZGGI7/HHI4JR2Uv5pabXsKim0fhYpbzUdsuZ+URRr69ktAYcyl70kC+ 93Kuji55nmAoElnPZd56Jxji6Ittsxr++OrxMmUEM2brodteOAmZPWpaEjxmhtXSZ2 7eP3E4apDLBBreqECKv9peuAq6FyF0hS8Mi7uLlOmLzk145PV1JjGUi3Ug2gG1ILY4 5c65o+3ujrP0g== From: Thomas Gleixner To: Oleg Nesterov Cc: Hyunwoo Kim , frederic@kernel.org, brauner@kernel.org, peterz@infradead.org, anna-maria@linutronix.de, ebiederm@xmission.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] signal: Use list_del_init_careful() in flush_sigqueue() In-Reply-To: References: <875x10hrkt.ffs@fw13> <8733w3j1i1.ffs@fw13> Date: Mon, 24 Aug 2026 14:11:50 +0200 Message-ID: <87zeybhg55.ffs@fw13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, Aug 24 2026 at 13:02, Oleg Nesterov wrote: > On 08/24, Thomas Gleixner wrote: >> >> --- a/fs/exec.c >> +++ b/fs/exec.c >> @@ -983,6 +983,18 @@ static int de_thread(struct task_struct >> } >> >> /* >> + * Ensure that POSIX timer SIGEV_THREAD_ID signals pending for >> + * the former leader are removed under sighand::siglock _before_ >> + * taking over the leader's TID. Otherwise the lockless cleanup >> + * in release_task() can race against a concurrent signal >> + * delivery to the new leader. The former leader has PF_EXITING >> + * set which prevents queueing of SIGEV_THREAD_ID signals up to >> + * the point where it's sighand gets cleared. >> + */ >> + scoped_guard(spinlock_irq, lock) >> + flush_sigqueue(&leader->pending); > > Hmm, at first glance... If we change de_thread() to do this _after_ transfer_pid's > (before release_task(leader)), then posixtimer_send_sigqueue() doesn't need any > changes, no? That should work nicely.