Messages in this thread | | | Date | Mon, 11 Mar 2019 13:28:48 -0700 | From | Andi Kleen <> | 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@linux.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
| |