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-03-28 20:30:18 +00:00
2009-03-12 12:58:02 -05:00
2008-01-11 18:22:30 -06:00
2006-09-12 17:12:31 -05:00
2006-09-12 17:12:31 -05:00
2008-10-16 16:52:06 +02:00
2009-03-13 15:48:43 -05:00
2009-03-12 12:58:02 -05:00
2008-12-29 11:24:14 -06:00
2008-08-29 02:13:10 -07:00
2008-11-30 10:03:36 -08:00
2008-10-09 08:56:13 +02:00
2006-09-12 17:12:31 -05:00
2009-03-12 12:58:02 -05:00
2009-03-12 12:57:58 -05:00
2009-03-12 12:58:02 -05:00
2009-03-13 16:08:49 -05:00
2008-01-30 13:14:02 -06:00
2008-12-28 20:00:03 +01:00
2009-03-13 16:08:49 -05:00
2006-09-12 17:12:31 -05:00
2008-01-30 13:14:02 -06:00
2008-01-30 13:14:02 -06:00
2009-03-12 12:58:10 -05:00
2009-03-12 12:58:10 -05:00
2008-10-23 11:42:17 -05:00
2009-03-12 12:58:05 -05:00
2007-07-18 11:16:32 -05:00
2008-07-02 15:06:25 -06:00
2009-03-12 12:57:54 -05:00
2009-03-17 21:43:52 -04:00
2009-03-17 21:43:52 -04:00
2008-02-07 18:02:44 -06:00
2009-03-12 12:58:02 -05:00
2009-01-02 12:02:25 -06:00
2009-03-12 12:58:04 -05:00
2008-10-23 11:42:19 -05:00
2006-11-15 16:43:50 -06:00
2007-10-19 23:22:55 +02:00