linux/net/core
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
..
datagram.c Network Drop Monitor: Adding kfree_skb_clean for non-drops and modifying end-of-line points for skbs 2009-03-13 12:09:28 -07:00
dev_mcast.c
dev.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-03-28 13:30:43 -07:00
drop_monitor.c Network Drop Monitor: Adding drop monitor implementation & Netlink protocol 2009-03-13 12:09:29 -07:00
dst.c
ethtool.c ethtool: Add RX pkt classification interface 2009-02-20 00:58:13 -08:00
fib_rules.c netlink: change nlmsg_notify() return value logic 2009-02-24 23:18:28 -08:00
filter.c
flow.c
gen_estimator.c
gen_stats.c
iovec.c
kmap_skb.h
link_watch.c
Makefile Network Drop Monitor: Adding Build changes to enable drop monitor 2009-03-13 12:09:29 -07:00
neighbour.c neigh: Allow for user space users of the neighbour table 2009-03-04 00:03:08 -08:00
net_namespace.c netns: Remove net_alive 2009-03-03 01:14:27 -08:00
net-sysfs.c net: fix warning about non-const string 2009-03-10 05:22:43 -07:00
net-sysfs.h
net-traces.c Network Drop Monitor: Add trace declaration for skb frees 2009-03-13 12:09:27 -07:00
netevent.c
netpoll.c
pktgen.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
request_sock.c
rtnetlink.c netlink: change nlmsg_notify() return value logic 2009-02-24 23:18:28 -08:00
scm.c
skb_dma_map.c
skbuff.c Network Drop Monitor: Adding kfree_skb_clean for non-drops and modifying end-of-line points for skbs 2009-03-13 12:09:28 -07:00
sock.c RDS: Add RDS to AF key strings 2009-02-26 23:43:19 -08:00
stream.c
sysctl_net_core.c sysctl: fix sparse warning: Should it be static? 2009-02-26 23:13:34 -08:00
user_dma.c
utils.c net: core: remove unneeded include in net/core/utils.c. 2009-03-26 01:11:48 -07:00