[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190311202848.GC29294@tassilo.jf.intel.com>
Date: Mon, 11 Mar 2019 13:28:48 -0700
From: Andi Kleen <ak@...ux.intel.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: acme@...nel.org, jolsa@...nel.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 02/10] perf, tools, stat: Avoid memory overrun with -r
On Mon, Mar 11, 2019 at 01:24:38PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
>
> When -r is used memory would get corrupted because the evsel->id array
> would get overrun. evsel->ids is a running counter of the last id.
> Normally this works fine, but with -r the same event is initialized
> multiple times, but not this counter, so it would keep growing
> beyond the array limit and corrupt random memory.
>
> Always reinitialize ->ids, and also add an assert to catch
> such overruns in the future.
>
> This fixes a perf segfault when running it from toplev.
This one should be Cc: stable
-Andi
Powered by blists - more mailing lists