linux/drivers/platform/x86
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
..
acer-wmi.c acer-wmi: double free in acer_rfkill_exit() 2009-03-16 00:37:33 -04:00
asus_acpi.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
asus-laptop.c asus-laptop: restore acpi_generate_proc_event() 2009-03-16 00:37:31 -04:00
compal-laptop.c
dell-laptop.c dell-laptop: move to drivers/platform/x86/ from drivers/misc/ 2009-01-16 14:32:18 -05:00
eeepc-laptop.c eeepc-laptop: restore acpi_generate_proc_event() 2009-03-16 00:37:31 -04:00
fujitsu-laptop.c fujitsu-laptop: Use RFKILL support bitmask from firmware 2009-02-21 21:59:55 -05:00
hp-wmi.c hp-wmi: fix error path in hp_wmi_bios_setup() 2009-02-05 12:56:47 -08:00
intel_menlow.c
Kconfig acer-wmi: Unmark as 'experimental' 2009-03-16 00:38:23 -04:00
Makefile dell-laptop: move to drivers/platform/x86/ from drivers/misc/ 2009-01-16 14:32:18 -05:00
msi-laptop.c
panasonic-laptop.c panasonic-laptop: fix X[ ARRAY_SIZE(X) ] 2009-01-17 20:20:13 -05:00
sony-laptop.c Rationalize fasync return values 2009-03-16 08:34:35 -06:00
tc1100-wmi.c Merge branch 'drivers-platform' into release 2009-01-09 04:56:56 -05:00
thinkpad_acpi.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
toshiba_acpi.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
wmi.c acpi-wmi: unsigned cannot be less than 0 2009-03-16 00:38:24 -04:00