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 44A444071CA for ; Mon, 24 Aug 2026 11:02:35 +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=1787569356; cv=none; b=TX66E5496IoNTJCOVWgUmquxlNudR+KREMbJuNEqnVsm1x5LGuc9c7MVKVdyMYFONYKS7L/FjYc5k7mPEHUz2Ll8cqCiVmM9h67/sYbgaIGHfBBvV5Mrg3WY71Pi0keqCCeLNcHO+T5WtMl/6is2vHaxHo9zKxDd7z9QS+GlMyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787569356; c=relaxed/simple; bh=fYNrBezXwzqsTeQ7YQOY7FHmi57HsfmX50yNF4nZbqs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R6zhj1IcND25DP9l1exuj6Ota8Lqcpsbu2yYOdNsYesvy13tt+siXs1xr0myULvHLXGdTzzqnqserOfKMjUHI3vBiZyFAysD0Z4MAF0gc6Z/hsAaHmSnmcSGFxvK28s1REuhleQ9dML6E2p91r070SdwlgU/FQqzEAuwcY4kTT8= 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=OmArwpa6; 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="OmArwpa6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1787569354; 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: in-reply-to:in-reply-to:references:references; bh=SjH9P29yxlD9rFVBu44ci9XIlK9Xhu1Bqpxs3zJGuIs=; b=OmArwpa69yf+Vn3EpwTuqmjekvrHWOREF7NyS70ZjJ26blHrhU+9UdsL3wGHK/KFI6Z+Dn jZN6NtzkeuBg558/QTqVZ81riRd/CvzuhKYnIfhZJvEwgAD8KJJXwGcx21iYdkM89+VOwN NWt1fotujAgd+6/XlANP0PLmOzRFwv4= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-634-okZpVUIWMQ2F73dS0ASyCg-1; Mon, 24 Aug 2026 07:02:29 -0400 X-MC-Unique: okZpVUIWMQ2F73dS0ASyCg-1 X-Mimecast-MFC-AGG-ID: okZpVUIWMQ2F73dS0ASyCg_1787569348 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CF7AD180ACC7; Mon, 24 Aug 2026 11:02:27 +0000 (UTC) Received: from fedora (unknown [10.44.32.9]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id CE32C18005B0; Mon, 24 Aug 2026 11:02:23 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 24 Aug 2026 13:02:27 +0200 (CEST) Date: Mon, 24 Aug 2026 13:02:22 +0200 From: Oleg Nesterov To: Thomas Gleixner 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() 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=us-ascii Content-Disposition: inline In-Reply-To: <8733w3j1i1.ffs@fw13> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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? Oleg.