From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from antelope.elm.relay.mailchannels.net (antelope.elm.relay.mailchannels.net [23.83.212.4]) by sourceware.org (Postfix) with ESMTPS id A89443858D20 for ; Thu, 25 May 2023 02:03:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A89443858D20 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 51DD87E203F; Thu, 25 May 2023 02:03:42 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CA7D37E1896; Thu, 25 May 2023 02:03:41 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1684980221; a=rsa-sha256; cv=none; b=gzHaFkQ7iqagGKJ1V77UZH25epLWH3Bj+ca5wzgGNTprpJCLsqOUquxc0D8aeQxuMWif5k /wodV6gbxxRzg/kHdYqwRjYhiiiwdeROdRJp+wA/32ZW5WUFNuVBkx07/+gdHSun/lHt5r N+/j09hLuAHgkoDI8l9imoaKptmNgabWLiEBDhHOAaWBEKpnj3TZRwKHRO9cyyCf6c9yvc Un+oJWvyUlatUvrD3JWWfzwg2cwiZKxC3FCKVhTHDuQg8aHmFnkSjxpcTqRKfGDYMWYAxp 9Kz3QMfk6CEE+5lUNa3e1FBwF8td0RhGy8zxdgzZ2NhwzJGaRqjWhiShK+eAbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1684980221; 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=1SoA/nfs8Zw/stpAjPshuBPD7W9Wup7uHi/h+6kxvrI=; b=SnK0F9aa6jdRaqQgCFT1EG/w8sNg0foOkVSL9VNjMr9MT+3wEXQRfiMghiHuACh7wKVz5Y eZq7tualzIR/SUeLkg//YUh9T4cYlQT4D8V17ZQn5Txzsvb4n+7/fIjHaScLqshPyuWTCs 6WK6mr965vvSc1jBNTCimp5TW14F0UQJQw7UcCSe7CT7N/Qm0Q6Ht7+9ckZ6n7FOiFUP9r kfxn5kikewV/vEM9KgCdbK+xOuiakdJBLqkSJQuxZkGTKAUrnoBV6yacGCywp0V3wWD5O5 gB2ZndINqOG1ehzWxqCEo20PTxsLQYFgzj/TQs5kUEeqE7BbcAgCx2eBqb3XhQ== ARC-Authentication-Results: i=1; rspamd-79bb5575d7-r82sw; 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-Hook-Illegal: 216649435085e759_1684980222144_1829161256 X-MC-Loop-Signature: 1684980222144:2753812027 X-MC-Ingress-Time: 1684980222143 Received: from pdx1-sub0-mail-a305.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 02:03:42 +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-a305.dreamhost.com (Postfix) with ESMTPSA id 4QRWYn34t1z1M; Wed, 24 May 2023 19:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1684980221; bh=1SoA/nfs8Zw/stpAjPshuBPD7W9Wup7uHi/h+6kxvrI=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=Scp1UtPHQsZ2/4w7LznjCLm0p8QvnufaHSek2fd64TqEYxgxxAnesIERp5OH23pTf 6wA29DlW6JzO7qcQCX6OUv5558cGHfzIYZhZv9AqQ5XoODrHoCqMyEETw9iBwlQ3bB rFFBJw8zXQW+OkcMAi04kXL3T6U8tHcCqzGljp8p6OTnWR2ocMp1QjWboOGhCveUWM XWG/M3C39/Fr2dr9lPHmNDAeSrb7lOdaJDfgPm5S+XpXnq670erNlG0vokHB9aToJG +Z1ZYj9pGaypxVGdVmpANOs5lymHH+pLRCDb5C7cTObDCc38cwrylLFQdJS7TLv2ZL L2ddxp9GFljvw== Message-ID: <383b5d3f-45f7-3aa7-2f2b-6fb314b1a988@gotplt.org> Date: Wed, 24 May 2023 22:03:40 -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: Andreas Schwab , libc-alpha@sourceware.org References: From: Siddhesh Poyarekar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3037.5 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-16 10: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(-) LGTM. Reviewed-by: Siddhesh Poyarekar > > 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))