Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp982725ybx; Thu, 7 Nov 2019 05:36:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwRbnbOZLRwgbAamW+ZKgnDODNhE6VPkIjtZHAT6U7nbUo1xz1oPZWWixc3vyZD0Q2v5N67 X-Received: by 2002:a17:906:f181:: with SMTP id gs1mr3024037ejb.13.1573133790484; Thu, 07 Nov 2019 05:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573133790; cv=none; d=google.com; s=arc-20160816; b=Ly/ByvE9ldYHhWjpyTWbfGH6LJuRJE7a8OZ3CBL33Nn/w3SXJlFrCTVvlnFVoCiEiU 6qjmlYscQOgs7SJ4MHYplqgExd5r8clfQUUPTFMEKNoO9hSO4XfRkM9Gw+Qcam1JJht6 SsAm8NfOEfgb7vVB8ZzlJ7WMNOLiUeAbPvhvn+pVqKW94BNW9UdnV/xf9mayjsPj6wQO X0/2RqRHDpa6h44qt28FRa0XwliWElzGucW+Xyb0w8FGkOmbfU3wP+6HAtxCNbivV/yq x3aby8d46fEvKVPLCGkzyB3vQoG0BgePnYuDGwUJSSZ4SRVP8Q5/AykKo/yaMa+fWBJ7 nmbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QsMx/Rzi9jt1CVd6i1Bxf3rbgQgAbHydGZouy+SYvww=; b=CFwAXJlhVDaZB/npKHgQ0ydwOtov/OVv0SX15ZP7aOe4baNFrCzQg/erIMsw+tFGj6 qrzX0iVgXPtLx836pHFF9q/kBwmVIlXLm184ERmxiO66EWY93POusmG/Abie7OYZISby 2Rzt1XIJHGLuItq73M3Xh9GwjR8yq5Dx1z1hZmO5sHQjsRBdOTGjPTiCOhFIvi+cgKFQ lNNuRKoNH6HCj7dBkxxZNAM9LhSX44mJpsx4QwXIs5kMxWzLhmFUe9wb8wEZQ4aXT0BT /XzHda/1IqjjUaOFOGyF1oVyzYrnqRDARZbJpFxkGTsOiU1PouVH+PDWFrgEi3hWCgER 8uFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tPW66xsu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a27si1537648edm.187.2019.11.07.05.36.06; Thu, 07 Nov 2019 05:36:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tPW66xsu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388776AbfKGNfR (ORCPT + 99 others); Thu, 7 Nov 2019 08:35:17 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:36621 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727858AbfKGNfR (ORCPT ); Thu, 7 Nov 2019 08:35:17 -0500 Received: by mail-yb1-f196.google.com with SMTP id v17so928675ybs.3 for ; Thu, 07 Nov 2019 05:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QsMx/Rzi9jt1CVd6i1Bxf3rbgQgAbHydGZouy+SYvww=; b=tPW66xsu1HWtLQdDzyNzHf0Wvlz0PNeThuxTCTYCe/JCb2vJQODRh8bWiZxGvn0Bt7 LR7RdcPYIl1IUVS7epNqoCYV6CawmyNvXhV5mWRlZb13fv/LMYw6lBxqpy3gsYa74EnW 0CWgdv/tvmdLrtq7/LERynoczFTBnpBddzZWuE96ELBU7OTbOyVq/VglbK+56Lc28ipm riWsDYp+rI9MGDc/36Dp2igeGLAjnQbQbiqsupzN+RgO6bQpMk4K3nIM+5rnYCGoJRLQ dNJ66epfzFso3O9SJII3x7iUP6w2j4d6TRTqg2PtabNgy4FLbUKJsJe3wNxoGnyUUgw/ FdBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QsMx/Rzi9jt1CVd6i1Bxf3rbgQgAbHydGZouy+SYvww=; b=ebwzWZll8sgKqupy5I0Lb4/ycI/pfT3+rJJ9nMPcajwSpJ58cEvCjD1s/tomS82dBI o9t65dwazmot9m9UUJUjurYgRa4Pxg4la0VNPun6LeutYqx3rH+ekn0EW3svxTxtCVAx 6fMjcB9iDZ5lUX7KvPdVd5OJXDWEVSPaP9neJtYF48d49F0Us07bEUYUl24gFMMCEOJF AF/5ydo9mY1C791MMUF63XCK8ly95bK1iJGmEOLGFPNFilLF7oPiSr3hPhrhksfobwsN +QgqSE7u8JkVNDSFX7Xo6HNh4l9f53Yk8X7R9KbfTwfQjiWELHEgZfDl0MmBq9sWycSf aQxw== X-Gm-Message-State: APjAAAWyeisY8QXMSKau+UL0+xRubMdEdthSa9g09eArOOdYBudw+I9p ZxlKGoduh1pNbbChb0/fDZ3Xyg== X-Received: by 2002:a25:b704:: with SMTP id t4mr3209953ybj.281.1573133716218; Thu, 07 Nov 2019 05:35:16 -0800 (PST) Received: from leoy-ThinkPad-X240s (li1038-30.members.linode.com. [45.33.96.30]) by smtp.gmail.com with ESMTPSA id p126sm733804ywc.16.2019.11.07.05.35.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Nov 2019 05:35:15 -0800 (PST) Date: Thu, 7 Nov 2019 21:35:07 +0800 From: Leo Yan To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , linux-kernel@vger.kernel.org, Naresh Kamboju Subject: Re: [PATCH v2] perf tests: Fix out of bounds memory access Message-ID: <20191107133507.GB32679@leoy-ThinkPad-X240s> References: <20191107020244.2427-1-leo.yan@linaro.org> <20191107094226.GC14657@krava> <20191107102029.GA32679@leoy-ThinkPad-X240s> <20191107120643.GA11372@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107120643.GA11372@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 09:06:43AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Nov 07, 2019 at 06:20:29PM +0800, Leo Yan escreveu: > > On Thu, Nov 07, 2019 at 10:42:26AM +0100, Jiri Olsa wrote: > > > [...] > > > > > To fix this issue, we will use evlist__open() and evlist__close() pair > > > > functions to prepare and cleanup context for evlist; so 'evsel->id' and > > > > 'evsel->ids' can be initialized properly when invoke do_test() and avoid > > > > the out of bounds memory access. > > > > right, we need to solve this on libperf level, so it's possible > > > to call mmap/munmap multiple time without close/open.. I'll try > > > to send something, but meanwhile this is good workaround > > > > > > Reviewed-by: Jiri Olsa > > > Thanks for reviewing, Jiri. > > > You are welcome to send us the fixing patches, I am glad to test it on > > qemu_arm. > > Thanks, applied after adding: > > Fixes: ee74701ed8ad ("perf tests: Add test to check backward ring buffer") > Cc: stable@vger.kernel.org # v4.10+ > > Please consider doing it next time, Thanks a lot for helping to add 'Fixes' tag, Arnaldo. Will note this for later patches. Thanks, Leo Yan