Re: perf: use-after-free in perf_event_for_each

From: Peter Zijlstra
Date: Tue Jan 24 2017 - 08:18:07 EST


On Mon, Jan 23, 2017 at 06:04:42PM +0100, Peter Zijlstra wrote:
> On Mon, Jan 23, 2017 at 02:30:12PM +0100, Dmitry Vyukov wrote:
> > Hello,
> >
> > The following program triggers use-after-free in perf_event_for_each:
> > https://gist.githubusercontent.com/dvyukov/f1c354a8356e42f4d0b3d912e1bec956/raw/31d7ecdf6dc2c7327b80ef8581a39c823bbe405d/gistfile1.txt

I've been running 60 concurrent instances of that thing for hours now,
and have not been able to reproduce :-/

I did enable CONFIG_KASAN but otherwise booted as normal, and the thing
says:

[ 0.000000] kasan: KernelAddressSanitizer initialized

Is there anything else I should do?

I've ran out of ideas and it would be very helpful if I could prod at
something that fails...