Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp407165imn; Wed, 27 Jul 2022 09:24:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vkyHZo2c9TQuMaN+DRlyc/AraDPs9awf4tpyVfN65gLBvoRzoMD1Ix10nC+g9g4VjDjiFd X-Received: by 2002:a17:907:86a6:b0:72e:e524:17f5 with SMTP id qa38-20020a17090786a600b0072ee52417f5mr18819454ejc.444.1658939073284; Wed, 27 Jul 2022 09:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658939073; cv=none; d=google.com; s=arc-20160816; b=Ulnn4wCPQsWlZcwjjgXNISI9AQjjviWUyKt+nPuDf0YAcukMWXJEpXmjUkXojKKl10 7P0kaFcrI/YjZ4IUIkIpbxrdcY7Tz0lY6Snl6oyWVpABtDamoQeeeockbDEIw5nS8UvP T/KymTlHUZtxF5TObjEtROamAwhS+eUKEZAby68/ML8cDfWmwu4wbn1w4FwUNZpyawVS vXOf9M0wJG07h2bC4mAi/zJlf+bKe2Msp94NUmgoEMlUMarUaGyBVXR+g7Y/awzyXmJU ahqvv9adtDMDdb/QKt+woJPBKR4ZHZ91ObdLXgBXQX/ivdpFz9zpODGmCsHPIA5B7VWy tsdA== 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=G5uaoCkoTqBe2WG7lihqpqoIyreTbOi/GvFJVoRcBiY=; b=zG1PIdaKf/XXuets4x85ipiEC+mTSbjjcyFJgkyYhKB9JawI5Xv7e0pyWW/3ubWQCr 10xiBE0uBxjb50djxDOjGNVTqGBkqAh3RhvrwhkD/MT4hHxwYoCPdpWR4NATTgYn1Ore Wb97bnuOODC57wvelSn8K3Oh+Uok+qqQCtgevwJI3lJ09xPl0pD08BRDcQZ4CSG5zMiX +hfNXhEvDiM888jRAUOwsBQQHeQIIDQmSjd1wCxy61Y/JdO9pkDF2vFEhjTmDFkXqucR CUGfaoT0ryKg2mskcVgv4w3T1PhS2cerhNDdytgldCR8n4+8uD93CXhJubS/rJdtIfLw V1zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nZ7n2ALC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds12-20020a170907724c00b006f3c6ceb0efsi20946409ejc.51.2022.07.27.09.24.08; Wed, 27 Jul 2022 09:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nZ7n2ALC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234392AbiG0Pzh (ORCPT + 99 others); Wed, 27 Jul 2022 11:55:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234418AbiG0Pze (ORCPT ); Wed, 27 Jul 2022 11:55:34 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EACB6DE88 for ; Wed, 27 Jul 2022 08:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=G5uaoCkoTqBe2WG7lihqpqoIyreTbOi/GvFJVoRcBiY=; b=nZ7n2ALCV85Ajrb8U2b7W6eZ7w NA6RcFhEueNJHpQTpKh8BA6uCXcrNc0Vt0KkadYrLy/h65yzh5xnGKf/dq/wf3r9mu4TpHV2JDb10 qJvQ3wwTGT6p2pNDWLyzDKNR4W2+CZDxhCRlWhqG5sWrYcJKkyXkwTtUryMVbvTfEzluaNIa2zJkk ZA/FyIaKWPFfscweKBBcxvESIf74042ZnvYmMpysY9DRJv3PZkx7ZB4BD8QdTJJxh8ZdKzNBQL4ih MlRzxBGO3VU7LX7cQKKj+XftIr5LPrFFq6U4WQyIIcYF7Wl2JYzYsnA+RbxKaqSw+LD3y3D6c5HZm otcEhFDA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGjNV-0031ex-Nc; Wed, 27 Jul 2022 15:55:17 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id C7C99980403; Wed, 27 Jul 2022 17:55:16 +0200 (CEST) Date: Wed, 27 Jul 2022 17:55:16 +0200 From: Peter Zijlstra To: Stanislav Goriainov Cc: Josh Poimboeuf , Ingo Molnar , linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] objtool: Fix memory leak in create_static_call_section() Message-ID: References: <20220727154825.3427-1-goriainov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220727154825.3427-1-goriainov@ispras.ru> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 27, 2022 at 06:48:25PM +0300, Stanislav Goriainov wrote: > On some paths of function create_static_call_section() the memory, > allocated for key_name via strdup(), is not freed. Even though this > is a utility function, and all memory will be freed automatically > after the process is finished, there is free(key_sym) in some cases, > so it would be sensible to always deallocate the memory. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > This is a run-once die on error program. This is pointless and most certainly doesn't 'fix' anything.