From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795962907; b=fA+uCP9MbwUX8zmQ6mhMdk3DpJT6yaypNTnEHj3io7a5ff7uqxVSy3ozVk8tjxh/7PaT p7xBMC48XsI2NvAPp7Vy4Gf5zhxMZj+b2hQuRlggkLJCssrpgVmvoY0KPIjwPOFswPYYY TD4URsEy04UWwBHtvd5xywHM7HSipylqLq/LEG8Eql0JOq3eO0IinB+Wh7L36/tYn3V7k sMKFT0OcHSsG4HbfNqMIkZ5z+B+17K8xlrIY15lftHYlEe4RX4nGvhhcenMPAP76T2Elw JlVzx6cKfNxNppOSDcO2+h7rd0eKjOzOxo1Wjfyarsui7n241RnaoP+xg8ZChkYdfHQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795962907; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Scanned-By; bh=4XqKpHDVIW//GOjN+vmnrmaSZRwkXWAG2z52MCk+s08=; b=0fOrdVoE4GGni+l5rf6hVomHRQOlPcYBcTMbcgJAZJYcBdF3dJ7HsRmEef2eD349e8KL BEiE94TmJxL7rIGNlohxGw9ShEszotGZtpmZEMhLOVdyw7hEmScA0WCJa2ZjA4uaPbSQq scpWmUBRljbGNzPVFR7veS3LeXjZGWKQ+rZOVA16ILlXNww8GNQa8jGxjS+1KoRiUeBoa +HMWA7Q7BPYP5jRnpklKoJhAzjp/IUNV8kuFnZ4Ty6ltmRO5l/nz0/RWHir4m11mbdd+E AdEGjItasCn/af1C4oZCslP1KUzJr/QpjwW8fOMZYIUps40oDheSJpiRY6F+VmRBJPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aN2M1x1x; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55484606A327 for ; Sun, 29 Nov 2026 14:35:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 55484606A327 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.a=rsa-sha256 header.s=mimecast20190719 header.b=aN2M1x1x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795962905; 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=4XqKpHDVIW//GOjN+vmnrmaSZRwkXWAG2z52MCk+s08=; b=aN2M1x1x4J4A/JmGDf2irXa3lfGutCbUnHJI03iCMzO+Nc2jC9vcSQy9F8doqVZNxbyCbR bidOkptA5y1obWw7hv852dMzeWiI7O33GTX8o7ziuBOcPtMhCx6AoYmCu+UYW3cYOYUyoA HEbS0T5ChainCEePdLVXwRUmKsVfilo= Received: from mx-prod-mc-06.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-272-e0PgZ0xcMOiUnF-5Z3WYcA-1; Sun, 29 Nov 2026 14:35:01 +0000 X-MC-Unique: e0PgZ0xcMOiUnF-5Z3WYcA-1 X-Mimecast-MFC-AGG-ID: e0PgZ0xcMOiUnF-5Z3WYcA_1795962899 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 915A61800351; Sun, 29 Nov 2026 14:34:59 +0000 (UTC) Received: from onestero-thinkpadp1gen7.tpbc.csb (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id E719C1956055; Sun, 29 Nov 2026 14:34:57 +0000 (UTC) Received: by onestero-thinkpadp1gen7.tpbc.csb (nbSMTP-1.00) for uid 13628 oleg@redhat.com; Sun, 29 Nov 2026 15:34:59 +0100 (CET) Date: Sun, 29 Nov 2026 15:34:56 +0100 From: Oleg Nesterov To: Andrew Morton Cc: Avi Weiss , Christian Brauner , "Eric W . Biederman" , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] signal: explain the still_pending check in dequeue_synchronous_signal() Message-ID: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 The "still_pending" logic in dequeue_synchronous_signal() is actually correct, but looks either unnecessary or incomplete: it is not clear how we can find another siginfo with the same .si_signo < SIGRTMIN; and if this is possible it is not clear why that siginfo can't be queued before "sync". Add a comment to explain both subtleties. Signed-off-by: Oleg Nesterov --- kernel/signal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/signal.c b/kernel/signal.c index 482db380a498..e744bd146e80 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -695,6 +695,11 @@ static int dequeue_synchronous_signal(kernel_siginfo_t *info) next: /* * Check if there is another siginfo for the same signal. + * + * sync->info.si_signo < SIGRTMIN, but posixtimer_queue_sigqueue() + * bypasses legacy_queue() and adds non-SI_FROMKERNEL SI_TIMER to + * the tail. It can't appear before SI_FROMKERNEL "sync" which had + * to pass legacy_queue() in __send_signal_locked(). */ list_for_each_entry_continue(q, &pending->list, list) { if (q->info.si_signo == sync->info.si_signo) -- 2.55.0