Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp886350ybx; Thu, 7 Nov 2019 04:11:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxwO8D9dUR+BajTE1U0ruzsZ/XuJuiqLFiU+oj/rxUTx63g9wllK0xwT92M5ivKf/jLU6oh X-Received: by 2002:a17:906:ecf5:: with SMTP id qt21mr2581667ejb.295.1573128664463; Thu, 07 Nov 2019 04:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573128664; cv=none; d=google.com; s=arc-20160816; b=U0Sq/gKGPVb2zeFKvt6uv9ubRXU3iTRXOeET7nnhjZVXXkRxk3NG6QY1J7Wriy9rnH dbhGYuImrEntVybIlMcQ6UALDGSaBgjPii0UDeiczvAianQVPvGEsiydDAOa+ToPkIum q1z9LLFjLZRpIu2tls4mhgCy5khLDaZGeV3g6vrnYZSyn3FGApj5Q70Hq6CO3Py738Sn ZyB7myZpDpRt4XJknaSCuwpTbJbBbA3UYtYTA6Ng7pwK1BtRpGmj1BWpvgWZZLNQJnst OqN6zIMBE4YrJx/y18kBxBCAPCzx9gizjdC8Ge8VPMhNksGFbLi6eKpZrUu9z3uW759T /IYg== 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:date:from:dkim-signature; bh=Ut33lTd+bs8Wz+qNBreL2KP/eGD0cRKA6+sRfDain58=; b=Mwo2v3oKALOmYCnJYJfJ/2frf1mlrluaPH+lxl96NXtfJbi28cG9pp892YhZAsuKW2 oQQjluVrHfZqDBOthmrDl1S7emkrf0wYy7tjOuYuc2sTwpw8kmyVSyuOVDQXQaMXNNse xSdKSEWZ8WBhV4yeXJMHvdIMbKxWbX7w6jvlKo3p3stuX7iD5QSRk8d25fH9bpk2ZuWV ACyCq6sjkUquzYNRgQ5AcX+UxB1M4aIWDOn9qYqsWe5zeNkMr+rPckrN0/NDQNRX1y9U a2yV5QG5612+430BoOzmknII2A1OPSCy29f8B7T7/G8LrLKNQeiyzPGvzMHYnTZNx59M Sx0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="UUS/BWOo"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi3si1268079edb.331.2019.11.07.04.10.38; Thu, 07 Nov 2019 04:11:04 -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=@gmail.com header.s=20161025 header.b="UUS/BWOo"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733122AbfKGMGu (ORCPT + 99 others); Thu, 7 Nov 2019 07:06:50 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:33450 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbfKGMGt (ORCPT ); Thu, 7 Nov 2019 07:06:49 -0500 Received: by mail-qk1-f195.google.com with SMTP id 71so1747166qkl.0 for ; Thu, 07 Nov 2019 04:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ut33lTd+bs8Wz+qNBreL2KP/eGD0cRKA6+sRfDain58=; b=UUS/BWOoKdv92simHAjU0rbpLeFTOtR79KozGwf4SSe6hr9uddS5O4AcYwTVuHdOz0 gFJ/6LO8+a4OFT6VfiVfZmHnhohacQPKrSYhVlooFPvPauhtRhWmETh9SjQHtBVUd/tf fU2xH5/bWFPGgx2azdxiu7SfCK1x2h3hZScURycY0vi4aKZrsfQ4yky+ytRee8D6xMaX cEQOVEvmw2btwt+oJhH++wrv7V/lz4lLSkQ0LtnjKFZ0C6h+v2rLOxpTA45DqrbRaVGH ocIdnX27+gmD1XLBKrs02zTXqY0gjoJNneYbjZMoIexD706u/axq1UiNR8srke7/zMTz RQmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ut33lTd+bs8Wz+qNBreL2KP/eGD0cRKA6+sRfDain58=; b=FxOw5Lq12wZBZW4qWPlIMUTnak50g0i4szPXfa4bOYuQ1YSCXD0nGId29WTxN/L4kZ ZhCAjSBWcwSuo6OjIRz209hdZO++z19V4qhEywVl/347ctuJ+zNI0PnAaS7FHx0xBKUn tNOCzI6q9PZC54gZ5UAuYqwZiLJChOPpAGqsTolNRhgZM86y0UGr+rToqz4p98kl4EhB NkCGAemRHJmI0TLHtvgaUGoImDsF1L0Etgg8XqYveWCJbqmaxk9qU7iLpaxM20M31i23 5PGj07I2UlSYDULimVpfKUtTpSR4tEBegnkb7Rv2xlYwHgF3Om7a0SPCTLS0dXhla1Lz Fi5w== X-Gm-Message-State: APjAAAXBaKI9hoLky4ds8IjjdwiqYtRF2p3QfbK4D4/GmK0iHiCclw6L zxV1vmKB1msveGtWnKFG7HE= X-Received: by 2002:a05:620a:13e2:: with SMTP id h2mr2487999qkl.114.1573128407008; Thu, 07 Nov 2019 04:06:47 -0800 (PST) Received: from quaco.ghostprotocols.net ([179.97.35.50]) by smtp.gmail.com with ESMTPSA id p66sm1154730qkd.1.2019.11.07.04.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 04:06:46 -0800 (PST) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 9BF0440B1D; Thu, 7 Nov 2019 09:06:43 -0300 (-03) Date: Thu, 7 Nov 2019 09:06:43 -0300 To: Leo Yan 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: <20191107120643.GA11372@kernel.org> References: <20191107020244.2427-1-leo.yan@linaro.org> <20191107094226.GC14657@krava> <20191107102029.GA32679@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107102029.GA32679@leoy-ThinkPad-X240s> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, - Arnaldo