From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932677Ab3ICJBe (ORCPT ); Tue, 3 Sep 2013 05:01:34 -0400 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:64948 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932298Ab3ICJBd (ORCPT ); Tue, 3 Sep 2013 05:01:33 -0400 X-AuditID: 9c93016f-b7cf0ae00000518f-37-5225a5692d14 From: Namhyung Kim To: Chenggang Qin Cc: linux-kernel@vger.kernel.org, root , David Ahern , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Arjan van de Ven , Yanmin Zhang , Wu Fengguang , Mike Galbraith , Andrew Morton , Chenggang Qin Subject: Re: [PATCH 1/3] perf core: Fix a mmap and munmap mismatched bug References: <1378049385-4466-1-git-send-email-chenggang.qin@gmail.com> Date: Tue, 03 Sep 2013 18:01:29 +0900 In-Reply-To: <1378049385-4466-1-git-send-email-chenggang.qin@gmail.com> (Chenggang Qin's message of "Sun, 1 Sep 2013 23:29:43 +0800") Message-ID: <87zjruth1y.fsf@sejong.aot.lge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chenggang, On Sun, 1 Sep 2013 23:29:43 +0800, Chenggang Qin wrote: > From: root > > In function filename__read_debuglink(), while the ELF file is opend and mmapped > in elf_begin(), but if this file is considered to not be usable during the > following code, we will goto the close(fd) directly. The elf_end() is skipped. > So, the mmaped ELF file cannot be munmapped. The memory areas are mmapped is > exist during the life of perf. This is a memory leak. > This patch fixed this bug. > Thanks. Reviewed-by: Namhyung Kim Thanks, Namhyung