Re: [PATCH] perf: fix alloc_callchain_buffers()

From: Frederic Weisbecker
Date: Wed Jan 26 2011 - 11:34:05 EST


On Tue, Jan 25, 2011 at 07:40:51PM +0100, Eric Dumazet wrote:
> Commit 927c7a9e92c4 ( perf: Fix race in callchains ) introduced a
> mismatch in the sizing of struct callchain_cpus_entries.
>
> nr_cpu_ids must be used instead of num_possible_cpus(), or we might get
> out of bound memory accesses on some machines.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
> CC: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> CC: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> CC: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> CC: David Miller <davem@xxxxxxxxxxxxx>
> CC: Stephane Eranian <eranian@xxxxxxxxxx>
> CC: stable@xxxxxxxxxx

Good catch, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/