From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E6B6818DB26 for ; Mon, 24 Aug 2026 14:29:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787581765; cv=none; b=pcVDiSMu0fNd1SOD1oG+1VujOAvkk3vXg9V9g/ON/tKyW0W8fE5WaPtuj18mWoLPcvqWyqomaAYfixBYFvM7gzyRZzymL8OwwRMFr9iUdIXdJlmZMVohIVNF2D0+PoAKrMrXg68Q6zoq283/+LCnheJZBOdt1TWen5yTGsZcuz0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787581765; c=relaxed/simple; bh=WMeTGSkjXL0zZhHoO7siIAO07CIaMjaEXkpeLu9GoKE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZkV+u0ois1MhzN9awXt4mqwIOGd7QeA8xn0eAPjJWmkh0XzeQN6HmH7Tf0wkQTM+mpiQ9HoRXnF7vEb5jJYIgd1MzMDqi4+0PHHdAb8tJ9oeAQ9PCy9GWFqT1cvcxsUR+8GoaGwLTy/o01N75Vjv21QXVaNjxV+UJIs3F0HBZ7w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=X8eo/Hze; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X8eo/Hze" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787581762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vgv8tqhDtUXGHX03ZP2tB9LaSqy04SynWKgV2cETIcY=; b=X8eo/Hze6qJgts36m3fjtolik95T3IXAByIgesKJnE69nQ7/3rBrGbdkakEtoWNI+shlEG bxRFzKFgiexTOHK+iA3n3PEcpmA+MQ5mnYdUDpuf7xZtmx4WXyIPz5isPjQP+qsG1ipHqc Yi2K7sx1D6BwuRCTl1KrHvUSFjKPpFk= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-hlVEMYYwN7yRRZ6K91mr5w-1; Mon, 24 Aug 2026 10:29:19 -0400 X-MC-Unique: hlVEMYYwN7yRRZ6K91mr5w-1 X-Mimecast-MFC-AGG-ID: hlVEMYYwN7yRRZ6K91mr5w_1787581757 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BD7B3195DE3C; Mon, 24 Aug 2026 14:29:17 +0000 (UTC) Received: from fedora (unknown [10.44.32.9]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 6182D1955F09; Mon, 24 Aug 2026 14:29:14 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 24 Aug 2026 16:29:17 +0200 (CEST) Date: Mon, 24 Aug 2026 16:29:12 +0200 From: Oleg Nesterov To: Frederic Weisbecker Cc: Thomas Gleixner , Hyunwoo Kim , 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() Message-ID: References: <875x10hrkt.ffs@fw13> <8733w3j1i1.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; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 On 08/24, Frederic Weisbecker wrote: > > Le Mon, Aug 24, 2026 at 01:54:26PM +0200, Oleg Nesterov a écrit : > > > > diff --git a/fs/exec.c b/fs/exec.c > > index a14f28b15607..550367e7fe6c 100644 > > --- a/fs/exec.c > > +++ b/fs/exec.c > > @@ -1029,6 +1029,9 @@ static int de_thread(struct task_struct *tsk) > > write_unlock_irq(&tasklist_lock); > > cgroup_threadgroup_change_end(tsk); > > > > + scoped_guard(spinlock_irq, lock) > > + flush_sigqueue(&leader->pending); > > + > > Is there something to prevent the timer from firing on another CPU, > racing with this tiny window and queue the signal to the old leader? After > all exchange_tids() is just some RCU pointers changed but there is nothing > to synchronize the readers before the flush_sigqueue(). So pid_task() may > still return the old leader after it? Ah yes... posixtimer_get_target() is obviously called before lock_task_sighand(), so it can be called even before exchange_tids()... Thanks! Oleg.