From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2C0E03858D1E for ; Wed, 2 Aug 2023 12:38:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2C0E03858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690979922; 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=XAuNAyzpo9tCZxblVP/fPYJ14YkPOygsafMihyHGf/c=; b=MhP+/S01qtEk3nqXyx/A/NMZu0amNpkE/YldlQXeU2lMDhH+SS6mrWUcS6+A50VsrdZuIB RExS+qzwJzvp0JlsjSlxazUU9wmlLATLe/lwOL8a+4eEt99k4JUtHVJBfo/Xon8G+KaLDa nCjQEOWidPkaV/qXTb7kUbvEx8wHluA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-147-sWg_6eb9NQmDJx0Z4SVlFg-1; Wed, 02 Aug 2023 08:38:41 -0400 X-MC-Unique: sWg_6eb9NQmDJx0Z4SVlFg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 175808870D0; Wed, 2 Aug 2023 12:38:41 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79ED5112132D; Wed, 2 Aug 2023 12:38:40 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella via Libc-alpha Cc: Carlos O'Donell , Adhemerval Zanella Subject: Re: [PATCH 2/2] stdlib: Make abort AS-safe (BZ 26275) References: <20230731171900.4065501-1-adhemerval.zanella@linaro.org> <20230731171900.4065501-3-adhemerval.zanella@linaro.org> Date: Wed, 02 Aug 2023 14:38:39 +0200 In-Reply-To: <20230731171900.4065501-3-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Mon, 31 Jul 2023 14:19:00 -0300") Message-ID: <87v8dxsjow.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Adhemerval Zanella via Libc-alpha: > diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c > index 44e45a4e23..e3364fb5d1 100644 > --- a/nptl/pthread_kill.c > +++ b/nptl/pthread_kill.c > @@ -69,6 +69,17 @@ __pthread_kill_implementation (pthread_t threadid, int signo, int no_tid) > return ret; > } > > +/* Send the signal SIGNO to the caller. Used by abort and called where the > + signals are being already blocked and there is no need to synchronize with > + exit_lock. */ > +int > +__pthread_raise_internal (int signo) > +{ > + struct pthread *pd = THREAD_SELF; > + int ret = INTERNAL_SYSCALL_CALL (tgkill, __getpid (), pd->tid, signo); > + return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0; > +} This needs to use gettid (the system call) so that it works after vfork, which may have an incorrect pd->tid. There should be a comment to this effect in pthread_kill implementation already. Thanks, Florian