From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bird.elm.relay.mailchannels.net (bird.elm.relay.mailchannels.net [23.83.212.17]) by sourceware.org (Postfix) with ESMTPS id 22F78383D005; Tue, 18 May 2021 04:49:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 22F78383D005 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=siddhesh@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 CE2705A0499; Tue, 18 May 2021 04:49:36 +0000 (UTC) Received: from pdx1-sub0-mail-a84.g.dreamhost.com (100-105-161-139.trex.outbound.svc.cluster.local [100.105.161.139]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5EA5E5A0780; Tue, 18 May 2021 04:49:36 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a84.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.105.161.139 (trex/6.2.1); Tue, 18 May 2021 04:49:36 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Shade-Duck: 005602160150458e_1621313376647_1403989141 X-MC-Loop-Signature: 1621313376647:824026442 X-MC-Ingress-Time: 1621313376647 Received: from pdx1-sub0-mail-a84.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a84.g.dreamhost.com (Postfix) with ESMTP id 18B5889A8B; Mon, 17 May 2021 21:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=subject:to :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=RqUZPz 8d2czSf+x1MoUIPSK4LDg=; b=RdjWYWbqHcR9QWl+Id0eQgAM5TXWVpw8AF/6dG u9avrt7eLPzADi3Cp+hYTz3qsP0tleYZxlCn5t1UCHJMwSHxFKZ6bhBJb0BlAQsB hI5tZgKFk1YDOck7u8wDGL1lFSDR2HzJr6Ck8nN5NgdDXZeGHaWGlX+9YKE7AXis BE3yc= Received: from [192.168.1.111] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a84.g.dreamhost.com (Postfix) with ESMTPSA id 71D3689A8A; Mon, 17 May 2021 21:49:33 -0700 (PDT) Subject: Re: [PATCH] ldconfig: Fix memory leaks To: Siddhesh Poyarekar , Adhemerval Zanella , libc-alpha@sourceware.org References: <20210511171627.360100-1-siddhesh@sourceware.org> <1ba04d0c-6b76-94e4-4c60-ad2246aa1357@linaro.org> X-DH-BACKEND: pdx1-sub0-mail-a84 From: Siddhesh Poyarekar Message-ID: <65de069f-72f6-e8c5-b5e6-1930bdfae607@gotplt.org> Date: Tue, 18 May 2021 10:19:28 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3029.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2021 04:49:39 -0000 On 5/18/21 9:13 AM, Siddhesh Poyarekar via Libc-alpha wrote: > On 5/17/21 10:45 PM, Adhemerval Zanella wrote: >> >> >> On 11/05/2021 14:16, Siddhesh Poyarekar via Libc-alpha wrote: >>> Coverity discovered that paths allocated by chroot_canon are not freed >>> in a couple of routines in ldconfig. >> >> LGTM, just a clarification about a specific change below. >> >> As a side note, reviewing this patch I think chroot_canon can be replaced >> with realpath. > > I'll post a separate patch for it. > After taking a closer look, I'm not sure if this is possible. chroot_canon does return the real path, but as if it were in a chroot. So if you have opt_chroot="/var/chroot" and path is "/var/chroot/usr/bin" then realpath(3) will give "/var/chroot/usr/bin" while chroot_canon() will return "/usr/bin". Do you think there's still scope for both to be equivalent? Siddhesh