Re: [PATCH] fork.c: copy_process(): fix cleanup WRT perf_event_free_task()

From: Ingo Molnar
Date: Mon Sep 29 2014 - 08:07:34 EST

* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> Subject: perf: Fix perf bug in fork()
> Oleg noticed that a cleanup by Sylvain actually uncovered a bug; by
> calling perf_event_free_task() when failing sched_fork() we will not yet
> have done the memset() on ->perf_event_ctxp[] and will therefore try and
> 'free' the inherited contexts, which are still in use by the parent
> process. This is bad..
> Suggested-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> Reported-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> Reported-by: Sylvain 'ythier' Hitier <sylvain.hitier@xxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Could this fix a couple of fuzzer triggered perf crashes perhaps?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at