]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: delete /proc THIS_MODULE references
authorAlexey Dobriyan <adobriyan@gmail.com>
Mon, 15 Jan 2018 21:45:32 +0000 (00:45 +0300)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 19 Jan 2018 13:10:53 +0000 (14:10 +0100)
commit15fbc825b0bcecf0821d5b69fb781bb68bb46403
tree8d49628098275a0a7ad91156ce04bd5efbf49e3d
parent2f32f95f4c67127d442fdbc11962c237adfff1c2
netfilter: delete /proc THIS_MODULE references

/proc has been ignoring struct file_operations::owner field for 10 years.
Specifically, it started with commit 9fa8363613a82d2170aefe3e79b806081a78e2ff
("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.

# ipvs
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipvs/ip_vs_app.c
net/netfilter/ipvs/ip_vs_conn.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/nf_conntrack_expect.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_log.c
net/netfilter/nf_synproxy_core.c
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c
net/netfilter/x_tables.c
net/netfilter/xt_hashlimit.c