From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bumble.maple.relay.mailchannels.net (bumble.maple.relay.mailchannels.net [23.83.214.25]) by sourceware.org (Postfix) with ESMTPS id 7BF8E385702F for ; Thu, 25 May 2023 12:37:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BF8E385702F 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 4AEC1921F39; Thu, 25 May 2023 12:37:44 +0000 (UTC) Received: from pdx1-sub0-mail-a306.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CF97A922294; Thu, 25 May 2023 12:37:43 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1685018263; a=rsa-sha256; cv=none; b=pnJuLvTjImxOgwS88+UfKm8Rtig48DxvYgB5V7ZVJM7nZr4AjSBjijioCZfVQt/9zvq+Gt FFsH6OirmjAsWXydIAram8UjiHV2r6ioGaiAqGsEb2tcBjNrLzMR1oYEjEiHXpD/bOfC0T tNZS2cpD/HXmnHKHoglHRaAiM8hTtqApmPCNElCv9YjuE4QGaDr7kECThGgEtY++AnixXs 4rzkwYGuVoYc1/MUl096YozxLzKIz4iB2yG/wGAzxNlDT0aoDsgfQX7hHR+WzPf6ZEfe51 hvGU8wUw6c/5PHgNlsm7UxeesdHP7HookkINoyYYJzGj8m8wSjHKFqrqtndygw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1685018263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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=9zKKJxOUroZESjsbC6D8D+Rq4hEcYbUnDKnMS92Gd4Q=; b=Y+NrEIPPEyuvueYfuF6I/KbGJI4EtK+Dzk6kyCPOpkfVvYrO0N8Fjw7P5XkGZM+blqB6G5 +oWfcoNANVQ0DhPWi8J0Ndle9tOkB3EW93iJ6AnJg03RFTxoB6s9k6JGbHwXxEWbLEIOl7 2TpXbA0F2IHZjeoPaQXytUeEbctFq0wmovEUyidSigZSceyTnHB2yGyMc+A8JIkuQ3GiHd iFbyp1/LOo4Z+4WGGE2b3mBouUcNdZm1fwRugMhQGXCWZw7iUUR8lEMuSEfXvfJqFPg+LX DNOvAPfvZ/H1K37ISz5G2SoXABMjrsmQgaZ54T6JCMN0aMG/GyH1EwEJYQHbEA== ARC-Authentication-Results: i=1; rspamd-79bb5575d7-nhjl6; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Exultant-Spot: 7a19a9b4669d38c1_1685018264114_2306164282 X-MC-Loop-Signature: 1685018264114:227968217 X-MC-Ingress-Time: 1685018264114 Received: from pdx1-sub0-mail-a306.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.123.193.157 (trex/6.8.1); Thu, 25 May 2023 12:37:44 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-02-142-113-138-85.dsl.bell.ca [142.113.138.85]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a306.dreamhost.com (Postfix) with ESMTPSA id 4QRndM1ShXz1n; Thu, 25 May 2023 05:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1685018263; bh=9zKKJxOUroZESjsbC6D8D+Rq4hEcYbUnDKnMS92Gd4Q=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=nzWn6I8RK0uYo/HO16+hVhRXD2c82T3ZBQpG8t/iRKqW5m/D9LcZejut3mGyNdwRZ 5X0K53ZGr2g0vJtCdwgsAEmc2VxR5eptH4n7v8D433nx2B7TrYF25FdCUtou+vhJ17 E8mqEC+4jSbA6ud7catZjydvQ2PlmKSU3hsR51sqp34Db8FCSgb+1GURdsph+MJxli 7KlrpKIKZ520WhEdXUdfG4oPt+9MGwy48IcJ3givxrVvlG5IaexGAJSIcVjZ4LvClW x7vMdd1Kiy+AQ9HRXtIjOrxUsoXL9OB6Q8S9Tn3tnt61FteJ075WfFAwhZGWC+2eym zyqPJNG7LCh6A== Message-ID: <8d8e0a6b-1839-9bc0-24f1-c2e69a1fadef@gotplt.org> Date: Thu, 25 May 2023 08:37:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] rtld: properly handle root directory in load path (bug 30435) Content-Language: en-US To: Adhemerval Zanella Netto , libc-alpha@sourceware.org, Andreas Schwab References: <7113237a-89e9-d7fc-4626-5ab23cc1bff6@linaro.org> From: Siddhesh Poyarekar In-Reply-To: <7113237a-89e9-d7fc-4626-5ab23cc1bff6@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3037.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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-05-25 08:33, Adhemerval Zanella Netto wrote: > > > On 16/05/23 11:37, Andreas Schwab via Libc-alpha wrote: >> Don't strip the trailing slash when checking for existence of a load path >> element to handle the special case of the root directory. >> --- >> elf/dl-load.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/elf/dl-load.c b/elf/dl-load.c >> index 39c63ff1b3..2aa487b49a 100644 >> --- a/elf/dl-load.c >> +++ b/elf/dl-load.c >> @@ -1859,7 +1859,7 @@ open_path (const char *name, size_t namelen, int mode, >> test whether there is any directory at all. */ >> struct __stat64_t64 st; >> >> - buf[buflen - namelen - 1] = '\0'; >> + buf[buflen - namelen] = '\0'; >> >> if (__stat64_time64 (buf, &st) != 0 >> || ! S_ISDIR (st.st_mode)) > > Which is difference between this and another fix for this very issue [1]? > And what about the testcase [2], this should really have a regression > tests. > > [1] https://sourceware.org/pipermail/libc-alpha/2023-May/147956.html > [2] https://sourceware.org/pipermail/libc-alpha/2023-May/147957.html > Ugh, sorry I missed them. I'll review the test case for inclusion. Thanks for keeping track! Sid