Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758601Ab0KOVOz (ORCPT ); Mon, 15 Nov 2010 16:14:55 -0500 Received: from mail-iw0-f174.google.com ([209.85.214.174]:63695 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758519Ab0KOVOr (ORCPT ); Mon, 15 Nov 2010 16:14:47 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=TN25vsbvnOOQyPD2s3PBTJc04l0tRD/83Up31IN1p2MqjWXLaLkzGvxOAFvXLvk1Ez 3yTwQr6WAEEOX4GbsbUxPoi+JWCnUPxwe9xOyyGOLbDh/f028Tye9siwvFIoTb8Pgj3n 2JOCQ+4VfJOq8blEYo1+AIGSFoO96kADkhgOM= Date: Mon, 15 Nov 2010 13:14:30 -0800 From: Dmitry Torokhov To: Vladislav Bolkhovitin Cc: Boaz Harrosh , Greg KH , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, scst-devel , James Bottomley , Andrew Morton , FUJITA Tomonori , Mike Christie , Vu Pham , Bart Van Assche , James Smart , Joe Eykholt , Andy Yan , Chetan Loke , Hannes Reinecke , Richard Sharpe , Daniel Henrique Debonzi Subject: Re: [PATCH 8/19]: SCST SYSFS interface implementation Message-ID: <20101115211430.GA19071@core.coreip.homeip.net> References: <20101109002829.GA22633@kroah.com> <4CD9A9B8.70708@vlnb.net> <4CDA6CD4.3010308@panasas.com> <4CDAFE6E.7050200@vlnb.net> <4CDBBE80.40908@panasas.com> <4CDC56F9.9040601@vlnb.net> <20101112012315.GE17097@core.coreip.homeip.net> <4CDEC8D2.8080101@vlnb.net> <20101115070436.GC14442@core.coreip.homeip.net> <4CE19A08.8050606@vlnb.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CE19A08.8050606@vlnb.net> 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 Content-Length: 1566 Lines: 40 On Mon, Nov 15, 2010 at 11:37:28PM +0300, Vladislav Bolkhovitin wrote: > Dmitry Torokhov, on 11/15/2010 10:04 AM wrote: > > >> This is because SYSFS doesn't hold references for the corresponding > >> kobjects for every open file handle. It holds references only when > >> show() and store() functions called. So, everything is under control and > >> a malicious user can do nothing to hold a reference forever. > > > > Right, Tejun plugged this particular (and very annoying) attributes > > behavior > > This behavior isn't annoying, it's GREAT, because it allows to use SYSFS > simply and reliably. Right, I mean that _before_ Tejun plugged that hole the behavior _was_ annoying. > > >, but that does not mean that this is the only way kobject's > > reference might be pinned. > > Could you be more specific and point out on exact ways for that? From my > quite deep SYSFS source code study I see such cases should not exist. While I do not know offhand I am sure there are such scenarios. Isn't there any way for the users that you are waiting on descend back into your module that is waiting for kobject removal and get stuck on some resource? Even if it isn't possible now the scheme is quite fragile. Kobjects are refcounted so work with them appropriately (rely on refcount, do not wait, etc). -- Dmitry -- 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/