Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2774330pxb; Mon, 19 Apr 2021 13:39:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5ne1+cuLD9FrKR3KpKra2G2JNjSc1zZ+CIEzC7U1g862pe2dhBy1RYVkujDNHYvzVo4G8 X-Received: by 2002:a05:6402:1103:: with SMTP id u3mr27401858edv.205.1618864773226; Mon, 19 Apr 2021 13:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618864773; cv=none; d=google.com; s=arc-20160816; b=NuatlY2iJ/VZ/vV7y2PP7Zx741f+4i5Rx/RU7+DOI2annLHakCfbTJERXLnm8h0Fvb N2wF10MlheDhsrVJP9zWtDMsNiq5bw0vwSVWaCh2KVToJvFxFCjyI/lCSHYXI84KpYLu T794oXwxRNQ5MF0GpIReaT5S1nwrEYITrlfhpImg62YHnXntTDoM/cLq/IfGsEk5woQk 4PDb8j1HnZvq5WEBMDKejrFeytXNx8Q3q3j7i1/PqR8OaIAnI9bfqt7/RxZUNU+eA/kv Eyx4rkkow1YpWZfHJBmFQuj15DWFh2CTs4fDNPR1q46om2Rg9BhIsZ4YxOXisb6ulEtD bR5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aIdGusNEUoxlZs58TKlk9SBuP2BQ1D6ukAplfOTfm+0=; b=CPH0AgEik8RtvTBhWksJkfxH5b7Vn39ePTJvq1XwPldvrVVTX//Bmqd+cGmh4gTHI0 Ki/26CuRSR8TI6DnWRd1sCsYYE9Bg7U74ve7qKNqfiBOa0sTocRhSTIqynyNlrk8TSzB EjDWhs3iDH9GUIi6G2a2oXS9shYAfiJcQJBTEhFRK/wEB4UBNgBm+ait3qsI1IIlv3BH wG+wqXqZ/18BpVHbAB8Jc8Sy5a6G9qIsPCFJHQXehiOQ0JeNJflPuAniArK5gpiIXOFh SZmD3qMDWsorjB0La1p0zIkAilAeOZnYbB7ZUspOavPJaFhDG8OavMcOp2uOCu+EQp6x ShIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZMQfD3Jv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si7812251ejm.249.2021.04.19.13.39.09; Mon, 19 Apr 2021 13:39:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZMQfD3Jv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239871AbhDSRQW (ORCPT + 99 others); Mon, 19 Apr 2021 13:16:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:34206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232572AbhDSRQV (ORCPT ); Mon, 19 Apr 2021 13:16:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 79E0C611F0; Mon, 19 Apr 2021 17:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618852551; bh=8KyYHrpSSLZ6bzyctVHE3NpW0Q8UJehavMJQewTSjQA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZMQfD3Jv2VKCkamBmuh6Df5UtWFjpD44ZXsp4C26QcuDgR/ZPXSuZy7joN+k2GR71 f7LpvyVMkAdCu+XXopx7ISNraTUQxaJaBwKcqlSkZlAA5WVboWoCWZPlpetDkM1nte krP7/ia6qw5f7sfILmQRKy/Ez8QsbHL/Tjlzv0U1p5dfVe6XpkwQrQhaFzTBQdwRCf tyDZa8EfdfReF+vaZjgKzAyf4tX1CJY9XFdtFM3SA4SupSCBm+mc1iK8Z8jLLSUxOu Sa7QRfiajQVflf8FGTSt60COO6QgZHSyoO+JrBI9v85GS4zZ9jU6ULENttDG2Na1Ap LpIxfIQnDS4zQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E385D40647; Mon, 19 Apr 2021 14:15:48 -0300 (-03) Date: Mon, 19 Apr 2021 14:15:48 -0300 From: Arnaldo Carvalho de Melo To: Peter Zijlstra Cc: Dan Carpenter , Muhammad Usama Anjum , Josh Poimboeuf , Ingo Molnar , Miroslav Benes , Borislav Petkov , open list , kernel-janitors@vger.kernel.org, colin.king@canonical.com Subject: Re: [PATCH] objtool: prevent memory leak in error paths Message-ID: References: <20210413204511.GA664936@LEGION> <20210414084709.GT6021@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Apr 15, 2021 at 09:24:41AM +0200, Peter Zijlstra escreveu: > On Wed, Apr 14, 2021 at 11:47:09AM +0300, Dan Carpenter wrote: > > On Wed, Apr 14, 2021 at 01:45:11AM +0500, Muhammad Usama Anjum wrote: > > > Memory allocated by sym and sym->name isn't being freed if some error > > > occurs in elf_create_undef_symbol(). Free the sym and sym->name if error > > > is detected before returning NULL. > > > > > > Addresses-Coverity: ("Prevent memory leak") > > > Fixes: 2f2f7e47f052 ("objtool: Add elf_create_undef_symbol()") > > > Signed-off-by: Muhammad Usama Anjum > > > --- > > > Only build has been tested. > > > > > > > Just ignore leaks from the tools/ directory. These things run and then > > exit and all the memory is freed. #OldSchoolGarbageCollector > > Mostly true; but I suspect tools/perf might care, it has some longer > running things in. Yes, and now we have 'perf daemon' that is long running. - Arnaldo