net: delete /proc THIS_MODULE references
authorAlexey Dobriyan <adobriyan@gmail.com>
Mon, 15 Jan 2018 21:42:40 +0000 (00:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Jan 2018 20:01:33 +0000 (15:01 -0500)
commit96890d62523c2cddc2c053ad29de35c4d935cf11
treec849442ebd9ae2f90531c8d127ec027790f5675d
parent868717ae73c5ad297b91fb52db1396f2336609a8
net: delete /proc THIS_MODULE references

/proc has been ignoring struct file_operations::owner field for 10 years.
Specifically, it started with commit 786d7e1612f0b0adb6046f19b906609e4fe8b1ba
("Fix rmmod/read/write races in /proc entries"). Notice the chunk where
inode->i_fop is initialized with proxy struct file_operations for
regular files:

-               if (de->proc_fops)
-                       inode->i_fop = de->proc_fops;
+               if (de->proc_fops) {
+                       if (S_ISREG(inode->i_mode))
+                               inode->i_fop = &proc_reg_file_ops;
+                       else
+                               inode->i_fop = de->proc_fops;
+               }

VFS stopped pinning module at this point.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
61 files changed:
net/8021q/vlanproc.c
net/appletalk/aarp.c
net/appletalk/atalk_proc.c
net/atm/br2684.c
net/atm/lec.c
net/atm/mpoa_proc.c
net/atm/proc.c
net/ax25/af_ax25.c
net/ax25/ax25_route.c
net/ax25/ax25_uid.c
net/bluetooth/cmtp/capi.c
net/can/bcm.c
net/can/proc.c
net/core/neighbour.c
net/core/net-procfs.c
net/core/pktgen.c
net/core/sock.c
net/decnet/af_decnet.c
net/decnet/dn_dev.c
net/decnet/dn_neigh.c
net/decnet/dn_route.c
net/ipv4/arp.c
net/ipv4/fib_trie.c
net/ipv4/igmp.c
net/ipv4/ipconfig.c
net/ipv4/ipmr.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/proc.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv4/udplite.c
net/ipv6/addrconf.c
net/ipv6/anycast.c
net/ipv6/ip6_flowlabel.c
net/ipv6/ip6mr.c
net/ipv6/mcast.c
net/ipv6/proc.c
net/ipv6/raw.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/udp.c
net/ipv6/udplite.c
net/ipx/ipx_proc.c
net/kcm/kcmproc.c
net/l2tp/l2tp_ppp.c
net/llc/llc_proc.c
net/netlink/af_netlink.c
net/netrom/af_netrom.c
net/netrom/nr_route.c
net/packet/af_packet.c
net/phonet/socket.c
net/rose/af_rose.c
net/rose/rose_route.c
net/rxrpc/proc.c
net/sched/sch_api.c
net/sctp/proc.c
net/unix/af_unix.c
net/wireless/wext-proc.c
net/xfrm/xfrm_proc.c