Re: [PATCH] perf: Fix vmalloc ring buffer free function

2013-02-27 Thread Jiri Olsa
On Wed, Feb 27, 2013 at 02:02:39PM +0100, Frederic Weisbecker wrote: > 2013/2/26 Jiri Olsa : > > If we allocate perf ring buffer with the size of single page, > > we will get memory corruption when releasing it. It's caused > > by rb_free_work function (the CONFIG_PERF_USE_VMALLOC option > > varian

Re: [PATCH] perf: Fix vmalloc ring buffer free function

2013-02-27 Thread Frederic Weisbecker
2013/2/26 Jiri Olsa : > If we allocate perf ring buffer with the size of single page, > we will get memory corruption when releasing it. It's caused > by rb_free_work function (the CONFIG_PERF_USE_VMALLOC option > variant). > > For single page sized ring buffer the page_order is -1 (because > nr_pa

[PATCH] perf: Fix vmalloc ring buffer free function

2013-02-26 Thread Jiri Olsa
If we allocate perf ring buffer with the size of single page, we will get memory corruption when releasing it. It's caused by rb_free_work function (the CONFIG_PERF_USE_VMALLOC option variant). For single page sized ring buffer the page_order is -1 (because nr_pages is 0). This needs to be recogni