lkml.org 
[lkml]   [2015]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perf: fuzzer triggers NULL pointer derefreence in x86_schedule_events
On Wed, May 20, 2015 at 03:03:12PM +0200, Peter Zijlstra wrote:
> So new in this release is:
>
> static void intel_put_event_constraints(struct cpu_hw_events *cpuc,
> struct perf_event *event)
> {
> ...
>
> /* cleanup dynamic constraint */
> if (c && (c->flags & PERF_X86_EVENT_DYNAMIC))
> event->hw.constraint = NULL;
> }
>
> Which is the only place that value is ever cleared...
>
> Now, I've not quite figured out how that can intersect with scheduling,
> typically we only call put_event_constraints() when we're done with the
> event.

Related to that; intel_commit_scheduling() has:

c = event->hw.constraint;

if (!c)
return;

Stephane, how can that ever be?

x86_schedule_events() does:
hwc->constraint = get_event_constraints()

for all events, and intel_get_event_constraints() will _always_ return a
valid constraint -- &unconstrained if nothing else.




\
 
 \ /
  Last update: 2015-05-20 16:01    [W:0.101 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site