Alexey Dobriyan 99b7623380 proc 2/2: remove struct proc_dir_entry::owner
Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
as correctly noted at bug #12454. Someone can lookup entry with NULL
->owner, thus not pinning enything, and release it later resulting
in module refcount underflow.

We can keep ->owner and supply it at registration time like ->proc_fops
and ->data.

But this leaves ->owner as easy-manipulative field (just one C assignment)
and somebody will forget to unpin previous/pin current module when
switching ->owner. ->proc_fops is declared as "const" which should give
some thoughts.

->read_proc/->write_proc were just fixed to not require ->owner for
protection.

rmmod'ed directories will be empty and return "." and ".." -- no harm.
And directories with tricky enough readdir and lookup shouldn't be modular.
We definitely don't want such modular code.

Removing ->owner will also make PDE smaller.

So, let's nuke it.

Kudos to Jeff Layton for reminding about this, let's say, oversight.

http://bugzilla.kernel.org/show_bug.cgi?id=12454

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
2009-03-31 01:14:44 +04:00
..
2009-01-02 10:19:38 -08:00
2008-06-20 14:05:55 -06:00
2008-12-13 11:25:49 -08:00
2008-10-20 08:52:41 -07:00
2008-12-13 09:12:07 +00:00
2008-07-20 17:12:36 -07:00
2008-06-20 14:05:57 -06:00
2008-12-03 21:04:09 +11:00
2009-01-02 10:28:32 -08:00
2009-01-31 01:21:59 +01:00
2008-06-20 14:05:48 -06:00
2008-02-07 08:42:25 -08:00
2008-04-30 08:29:43 -07:00
2008-07-24 10:47:14 -07:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:19:40 -08:00
2009-01-02 10:19:40 -08:00
2007-02-12 09:48:30 -08:00
2009-01-12 16:37:00 -08:00
2009-01-02 10:19:40 -08:00
2008-07-20 17:12:38 -07:00
2009-01-08 16:44:03 -07:00
2009-02-22 09:23:02 -08:00
2009-01-02 10:19:40 -08:00
2009-03-16 08:34:35 -06:00
2008-07-20 17:12:38 -07:00
2009-01-02 10:19:40 -08:00
2008-06-20 14:05:51 -06:00
2008-04-30 23:15:34 +02:00
2008-12-09 20:32:06 +11:00
2009-03-16 08:32:27 -06:00
2009-01-02 10:19:38 -08:00
2008-10-16 16:52:05 +02:00
2009-01-02 10:19:40 -08:00