From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754650Ab2DCO2E (ORCPT ); Tue, 3 Apr 2012 10:28:04 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53054 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752897Ab2DCO2D (ORCPT ); Tue, 3 Apr 2012 10:28:03 -0400 Subject: Re: [PATCH] Prevent crash on missing sysfs attribute group From: Peter Zijlstra To: "Eric W. Biederman" Cc: Ingo Molnar , Bruno =?ISO-8859-1?Q?Pr=E9mont?= , Greg KH , linux-kernel@vger.kernel.org, Linus Torvalds In-Reply-To: References: <20120402162716.4c93bfd3@pluto.restena.lu> <20120402165036.2bc987ad@pluto.restena.lu> <20120402213440.49e9de74@neptune> <1333401898.2960.78.camel@laptop> <1333403193.2960.80.camel@laptop> <20120403060252.GA27084@gmail.com> <20120403081735.78ca3bb3@pluto.restena.lu> <20120403071543.GA17502@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 03 Apr 2012 16:27:44 +0200 Message-ID: <1333463264.2960.99.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2012-04-03 at 00:50 -0700, Eric W. Biederman wrote: > > So I am asking that since perf is built in a way that actively makes > debugging these kinds of problems hard that you please add additional > debugging code to perf_pmu_register or some other better location so > that simply registering something buggy with perf will show the bug. > > Is there a convenient helper function that we can use that validates the attribute_group structure? We could use such a function to do the validation at a point where we still know where it came from.