Re: [PATCH 11/11] perf: Avoid uninitialized sample type reference in__perf_event__output_id_sample

From: Peter Zijlstra
Date: Wed Oct 02 2013 - 04:57:53 EST


On Mon, Sep 30, 2013 at 01:29:12PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> __perf_event__output_id_sample looks at data->type to decide
> what to output.
>
> A lot of of the custom output functions, for example perf_log_throttle
> start with perf_event_header__init_id, which only initializes
> the header when event->attr.sample_id_all is true.
>
> But when this is false the output function is still called,
> and will look at an uninitialized header.
>
> I changed all the callers to perf_event_header__init_id
> to __perf_event_header__init_id which unconditionally
> initializes the header.
>
> FWIW I'm not fully sure this is the correct fix and what the
> exact semantics of sample_id_all are supposed to be.
> Should it disable all throttling etc. messages?
> Please review carefully.

Why are you doing this; also what's up with 11/11?
--
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/