From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 1385A3858D32 for ; Thu, 25 May 2023 12:33:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1385A3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6ad13a1fbceso1083477a34.2 for ; Thu, 25 May 2023 05:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685018034; x=1687610034; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vhbzi/h4c4bDWYkbq4JgKQ5H01+wNcWwSMuKpGigDeE=; b=RQB62wcEY4LT6OUysyqQNdmji7AOiwPK/yvTnqWD1QqCuSx7mEYnwtcM1OVHpRLU9D kCvnJZMMmKDvGDPb+71FQ42/skG93fGhj/a7aFKgzAml9X8KIJWT4l8db9IlLFKt3TJ7 B/BGu6OLPODibphZGiWfUpwsjPXTF5p56NsJJO1V2RK8J0lFZRJuXRvyOswtvqWmWDht LE6RmeDUdwAD+A9DLs2vSFhuvepBpJuu93xOoGTXqrW34vpMc5A+QFEgMN9W5dp+jIAV +zRXFsRlbC4WbQiIzENBMolY8yB99SGGH5Ua4s/jS82VCSdWbN4/uj/uIQjq2/9Df+Cc xXWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685018034; x=1687610034; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vhbzi/h4c4bDWYkbq4JgKQ5H01+wNcWwSMuKpGigDeE=; b=GudF+vDsBOm65n+TU5YBVtGz3vMOJ6oT9Bf73MMni64GPmd99f0T0degAmXqPHZ3Av EIfENFpPKqlr4y8EFepg8+di8ohfLO9xEj+sZEqLXetfolR7JRhffna3cfU6A3BWowfm bpcSA7K90dxqb0XAFAZ0GCCD/kN2LzFmtrg/8T0kjCH2R3qZyr9gG7fHnJAHpqjmCkOF xH0gtB2hekWotr76nYlA7V6TO99FDVrGUgUV+TzQ9A3Lb/6Q6ZNDeMFnKefdC3zJKWMn H0t5OqAJEKbk7s5+H41b9rEcAWfxjjot2tWmIg2M9dN7m06gykm5iMyuzJOATrwz7jv9 ONtA== X-Gm-Message-State: AC+VfDyQBXoJ6P4Ahd+47C+8VCEILKYd2Tokgusy10XGuUkgToKwl1zr U1jOyXIBxsh3OJXzWIGEtaT/z+hDIUvIt4Jb2ceS4Q== X-Google-Smtp-Source: ACHHUZ6GOrXVycmvZQ+vnAXjQ9gCfX4sZ1GIFd3mXrxFcmVMMiL9Y7RxYUiFqCMZBgneM1+hxBweWg== X-Received: by 2002:a05:6830:3a8f:b0:6a6:389f:ad9c with SMTP id dj15-20020a0568303a8f00b006a6389fad9cmr11479962otb.28.1685018033858; Thu, 25 May 2023 05:33:53 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:4dd5:80c6:51f7:4cf7:20d3? ([2804:1b3:a7c1:4dd5:80c6:51f7:4cf7:20d3]) by smtp.gmail.com with ESMTPSA id r14-20020a9d750e000000b006ade3815527sm576963otk.22.2023.05.25.05.33.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 May 2023 05:33:53 -0700 (PDT) Message-ID: <7113237a-89e9-d7fc-4626-5ab23cc1bff6@linaro.org> Date: Thu, 25 May 2023 09:33:50 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] rtld: properly handle root directory in load path (bug 30435) Content-Language: en-US To: libc-alpha@sourceware.org, Andreas Schwab , Siddhesh Poyarekar References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.3 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 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