lkml.org 
[lkml]   [2003]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Flaw in the driver-model implementation of attributes
On Mon, Jun 16, 2003 at 08:00:33PM +0200, Martin Diehl wrote:
> with old procfs one would like to set the owner field of the
> corresponding struct proc_dir_entry and/or file_operations at this point.
>
> > - userspace opens new file (this does not increment the device drivers
> > use count.)
>
> given owner=THIS_MODULE was set, this would bump the module's use count

... and for objects that have lifetime different from that of any module
this approach fucks up with procfs just as badly as with sysctl or sysfs.

Folks, _forget_ modules. ->owner is OK for many things, but for stuff
like procfs it's not enough. It only protects code. procfs and sysfs
entries are _data_. And in cases when it is OK the data is protected
by separate refcounts.

Folks, please, stop assuming that rmmod is the root of all evil and/or
place to deal with said evil. Objects can be and are destroyed regardless
of rmmod.
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.050 / U:1.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site