From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755818Ab2DCX0W (ORCPT ); Tue, 3 Apr 2012 19:26:22 -0400 Received: from mail-pz0-f52.google.com ([209.85.210.52]:43344 "EHLO mail-pz0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755251Ab2DCX0V (ORCPT ); Tue, 3 Apr 2012 19:26:21 -0400 Date: Tue, 3 Apr 2012 16:26:17 -0700 From: Greg KH To: "Eric W. Biederman" Cc: Peter Zijlstra , Ingo Molnar , Bruno =?iso-8859-1?Q?Pr=E9mont?= , linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [PATCH] Prevent crash on missing sysfs attribute group Message-ID: <20120403232617.GA733@kroah.com> References: <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> <1333463264.2960.99.camel@laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 03, 2012 at 04:22:46PM -0700, Eric W. Biederman wrote: > Peter Zijlstra writes: > > > 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. > > There isn't but I was just thinking before you sent this that we could > really use one. Let me look into this some more, the driver core really should be protecting you from doing something like this here, sysfs shouldn't be getting involved (not to say that the patch is incorrect, it isn't, I'll queue it up, but that something more looks to be needed to keep from hitting that problem in the first place.) thanks, greg k-h