From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754125AbcFGJPw (ORCPT ); Tue, 7 Jun 2016 05:15:52 -0400 Received: from mail.skyhub.de ([78.46.96.112]:52074 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbcFGJPu (ORCPT ); Tue, 7 Jun 2016 05:15:50 -0400 Date: Tue, 7 Jun 2016 11:15:46 +0200 From: Borislav Petkov To: David Carrillo-Cisneros Cc: linux-kernel@vger.kernel.org, "x86@kernel.org" , Ingo Molnar , "Yan, Zheng" , Andi Kleen , Kan Liang , Peter Zijlstra , Stephane Eranian Subject: Re: [PATCH] perf/core: make account/unaccount_sb_event consistent Message-ID: <20160607091546.GB1170@pd.tnic> References: <1464809585-66072-1-git-send-email-davidcc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1464809585-66072-1-git-send-email-davidcc@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 01, 2016 at 12:33:05PM -0700, David Carrillo-Cisneros wrote: > unaccount_pmu_sb_event did not check for attributes in event->attr > before calling detach_sb_event, while account_pmu_event did. > > This caused NULL pointer reference in cgroup events that did not > have any of the attributes checked by account_pmu_event. > > To trigger the bug just wait for a cgroup event to terminate, e.g.: > > $ mkdir /dev/cgroup/devices/test > $ perf stat -e cycles -a -G test sleep 0 > > ... see crash ... > > Patch rebased on peterz/queue/perf/core . > > Reviewed-by: Stephane Eranian > Signed-off-by: David Carrillo-Cisneros > --- > kernel/events/core.c | 34 ++++++++++++++++++---------------- > 1 file changed, 18 insertions(+), 16 deletions(-) Tested-by: Borislav Petkov -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.