Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753477AbbETNPs (ORCPT ); Wed, 20 May 2015 09:15:48 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:41173 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393AbbETNPq (ORCPT ); Wed, 20 May 2015 09:15:46 -0400 Date: Wed, 20 May 2015 15:15:25 +0200 From: Peter Zijlstra To: Vince Weaver Cc: Stephane Eranian , LKML , Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Paul Mackerras Subject: Re: perf: fuzzer triggers NULL pointer derefreence in x86_schedule_events Message-ID: <20150520131525.GG18673@twins.programming.kicks-ass.net> References: <20150501125955.GF5029@twins.programming.kicks-ass.net> <20150507124300.GK23123@twins.programming.kicks-ass.net> <20150520130312.GL3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150520130312.GL3644@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1134 Lines: 40 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/