From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id E8F99385783A for ; Wed, 14 Oct 2020 10:43:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E8F99385783A X-IronPort-AV: E=Sophos;i="5.77,374,1596492000"; d="scan'208";a="472535813" Received: from unknown (HELO function) ([193.50.111.115]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2020 12:43:10 +0200 Received: from samy by function with local (Exim 4.94) (envelope-from ) id 1kSeFS-0003rQ-2g; Wed, 14 Oct 2020 12:43:10 +0200 Date: Wed, 14 Oct 2020 12:43:10 +0200 From: Samuel Thibault To: Jessica Clarke Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , libc-alpha@sourceware.org, bug-hurd@gnu.org, Jan Nieuwenhuizen Subject: Re: [PATCH] hurd: '_hurd_raise_signal' checks signal number is valid Message-ID: <20201014104310.7ixwjyz3xamde3g6@function> Mail-Followup-To: Jessica Clarke , Ludovic =?utf-8?Q?Court=C3=A8s?= , libc-alpha@sourceware.org, bug-hurd@gnu.org, Jan Nieuwenhuizen References: <20201013135744.mpizainhz43e5vkl@function> <20201013211657.1869-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2020 10:43:21 -0000 Hello, Jessica Clarke, le mar. 13 oct. 2020 22:20:15 +0100, a ecrit: > On 13 Oct 2020, at 22:16, Ludovic Courtès wrote: > > Previously, 'pthread_kill (pthread_self (), -1)' would wrongfully > > succeed: > > > > https://lists.gnu.org/archive/html/guix-devel/2020-10/msg00152.html > > --- a/hurd/hurd-raise.c > > +++ b/hurd/hurd-raise.c > > @@ -28,6 +28,9 @@ int > > _hurd_raise_signal (struct hurd_sigstate *ss, > > int signo, const struct hurd_signal_detail *detail) > > { > > + if (signo < 1 || signo >= _NSIG) > > + return EINVAL; > > + > > From pthread_kill(3): > > If sig is 0, then no signal is sent, but error checking is still performed. > > I interpret that as meaning it validates thread but ignores sig. __pthread_kill actually already check for sig == 0, _hurd_raise_signal is really not supposed to be called with sig == 0. But thanks for making sure we don't miss that case :) Samuel