From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bongo.pear.relay.mailchannels.net (bongo.pear.relay.mailchannels.net [23.83.216.21]) by sourceware.org (Postfix) with ESMTPS id 470DD38768BB for ; Fri, 30 Jun 2023 15:48:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 470DD38768BB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8DC575C17DA; Fri, 30 Jun 2023 15:48:34 +0000 (UTC) Received: from pdx1-sub0-mail-a286.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B22F35C1919; Fri, 30 Jun 2023 15:48:33 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1688140113; a=rsa-sha256; cv=none; b=h9RVVXKLlhSTjOVa0tq43eqyMAwGNFJby8Hnojejjggjj1f97sITSeuXyUVahTMtUv3mzt yiVUj0c728vsH7j5AOC/RYvXHigCcpe/39VRAv1vOnTPz288EUljVhJvmFbe2MMNkkCVQp 37RkNU1Zu56oCMR8Z1G71zVme7c6/Pcppjz+ZTi12MowciHTSapcPUFua8EpLFjRdP9Oma HTZUq2eKbvLu0wbPjV7O+7rvtnfPibcr3GAVsVHH2kdiRlGi4QgSObg/obMUOfGuvJvos4 fKN3VPSjnxwl+mPXOcCoFH0p/5QAg0f9LAIFqHHjWDW7+MB5YVmiDssgvNBpSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1688140113; 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:dkim-signature; bh=dC3Xio1EFe3fkMuTsG101ZV24K/DPFAAE0HdFNY6w78=; b=1a74isdeFUo6r31pzbS5gUwYFoOmZsl/2o0QiotDyDcYF7mxhhRjR/MZWDjs7q1NjVtOPO PzqWQ+ahLKWKqu6Ub+aBajUFeb/sw4WyyyMHtXwPJXWTORaeLGwu29YjoIYtxtEfzEP2AY h9922pAddWuoeTFibUi9HfsyKsMebXnsfLEkqZuSOkAWv2BGsnccq7gJXJ6eCCAxYV7YVj jB4z6qil2tjLboSDThBkXgjlgjI8honXEO1t97QUpBfkh4JjHV3v9EIs9AuXMiXYUhLEAX SBNi62OZEo4qNezyGmVU0qYlZXpZtNdWUypPkVJRtOq9Kms0HuOxf1XnDNz0Sw== ARC-Authentication-Results: i=1; rspamd-85899d6fcc-d4zwr; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Good X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Grain-Company: 084714ce0279c381_1688140114360_2754302918 X-MC-Loop-Signature: 1688140114360:3712053821 X-MC-Ingress-Time: 1688140114360 Received: from pdx1-sub0-mail-a286.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.193.136 (trex/6.9.1); Fri, 30 Jun 2023 15:48:34 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-09-174-91-45-44.dsl.bell.ca [174.91.45.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a286.dreamhost.com (Postfix) with ESMTPSA id 4Qt08x2GHTzn6; Fri, 30 Jun 2023 08:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1688140113; bh=dC3Xio1EFe3fkMuTsG101ZV24K/DPFAAE0HdFNY6w78=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=s8MzDZSdYw/rdBEHVrrLGOYP7aVNZUcS7aqGN3bJ5dEOlTci/Dcon/P6Zxgj9CHoy JnxnB1GtqJNqB1O7iJYfYTk5rsaXHifolRGKLOkK5Wl+PDIguxWVe8ixQtLWn/ci1y xgf2CKhH1aSsRGYXBbXmk0W8mbmvxZnVl9TDd9P126Z5F7EL7yfxtwZ5y6Jcoxh5Ad 3ffXQOxwu6n3vAagXP8xzQkc1dz2vLo9Y3Ge7x744NaJUPje3trsywXqIHwDISZk6X xSFtNPdp08b+GoZ5wBqa/BtzVeWFLaIDfXpcvBViriz+aVf2kvunMqXDBABQVhSHkB OWAnMr1Hbna1w== Message-ID: <89555123-2e8c-c771-22ad-f5a2d41812eb@gotplt.org> Date: Fri, 30 Jun 2023 11:48:32 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 14/16] libio/bits/stdio2-decl.h: Avoid PLT entries with _FORTIFY_SOURCE Content-Language: en-US To: Frederic Berat Cc: libc-alpha@sourceware.org References: <20230628084246.778302-1-fberat@redhat.com> <20230628084246.778302-15-fberat@redhat.com> <514ef51d-5501-5af9-baf6-4885cbcd9fc7@gotplt.org> From: Siddhesh Poyarekar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3037.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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: On 2023-06-30 11:38, Frederic Berat wrote: > > > On Fri, Jun 30, 2023 at 5:30 PM Siddhesh Poyarekar > wrote: > > > > On 2023-06-28 04:42, Frédéric Bérat wrote: > > The change is meant to avoid unwanted PLT entry for the > fgets_unlocked > > routine when _FORTIFY_SOURCE is set. > > --- > >   libio/bits/stdio2-decl.h | 2 +- > >   1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libio/bits/stdio2-decl.h b/libio/bits/stdio2-decl.h > > index 114b06d24b..d7ef7283d6 100644 > > --- a/libio/bits/stdio2-decl.h > > +++ b/libio/bits/stdio2-decl.h > > @@ -122,7 +122,7 @@ extern size_t __fread_chk (void *__restrict > __ptr, size_t __ptrlen, > >                          FILE *__restrict __stream) __wur; > > > >   #ifdef __USE_GNU > > -extern char *__REDIRECT (__fgets_unlocked_alias, > > +extern char *__REDIRECT_FORTIFY (__fgets_unlocked_alias, > >                        (char *__restrict __s, int __n, > >                         FILE *__restrict __stream), fgets_unlocked) > >       __wur __attr_access ((__write_only__, 1, 2)); > > Why not the same for all the others? > > > I tend to avoid modifying things that are not strictly necessary. If > that happens to be needed on other aliases, then everything is ready for > it, but it seems I didn't stumbled upon a case where it was ... > When you look at it, the same way I didn't create libc_hidden_def/proto > for all the routines here (like e.g. __fread_chk) if that wasn't needed. So there's a slight difference; the __REDIRECT_FORTIFY is essentially an assurance that whenever there's an internal use of this function, the alias will redirect to that internal alias. The hidden_def adds an alias, which is unnecessary until there's an actual internal use and the hidden_proto is only a complement to the hidden_def. In that sense, I think the __REDIRECT_FORTIFY should be for all function aliases, not just the ones that are currently being used. Sid