From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762450AbcALOYc (ORCPT ); Tue, 12 Jan 2016 09:24:32 -0500 Received: from mail.kernel.org ([198.145.29.136]:54055 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762428AbcALOY3 (ORCPT ); Tue, 12 Jan 2016 09:24:29 -0500 Date: Tue, 12 Jan 2016 11:24:26 -0300 From: "acme@kernel.org" To: "Wangnan (F)" Cc: =?utf-8?B?5bmz5p2+6ZuF5bezIC8gSElSQU1BVFXvvIxNQVNBTUk=?= , "jolsa@kernel.org" , "linux-kernel@vger.kernel.org" , He Kuang , Namhyung Kim , Zefan Li , "pi3orama@163.com" Subject: Re: [PATCH 16/53 v2] perf tools: Fix mmap2 event allocation in synthesize code Message-ID: <20160112142426.GT18367@kernel.org> References: <20160111210327.GG18367@kernel.org> <1452593524-138970-1-git-send-email-wangnan0@huawei.com> <50399556C9727B4D88A595C8584AAB3752692616@GSjpTKYDCembx32.service.hitachi.net> <5694DA9B.6080704@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5694DA9B.6080704@huawei.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Jan 12, 2016 at 06:51:07PM +0800, Wangnan (F) escreveu: > On 2016/1/12 18:49, 平松雅巳 / HIRAMATU,MASAMI wrote: > >>From: Wang Nan [mailto:wangnan0@huawei.com] > >>perf_event__synthesize_mmap_events() issues mmap2 events, but the > >>memory of that event is allocated using: > >> > >>mmap_event = malloc(sizeof(mmap_event->mmap) + machine->id_hdr_size); > >> > >>If path of mmap source file is long (near PATH_MAX), random crash > >>would happen. Should use sizeof(mmap_event->mmap2). > >> > >>Fix two memory allocations. > >Looks good to me. But hope to have another rename patch soon after this... > > According to Arnaldo, we don't need rename patch. He think mmap_event > is okay. Right? Right, no need for the rename. - Arnaldo