summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nfnetlink_queue.c
diff options
context:
space:
mode:
authorDenis V. Lunev2008-03-28 00:55:53 +0100
committerDavid S. Miller2008-03-28 00:55:53 +0100
commit8eeee8b152ae6bbe181518efaf62ba8e9c613693 (patch)
treeb5900762ddf2a5d03ed31da629b726c6fd6a710f /net/netfilter/nfnetlink_queue.c
parent[ESP]: Ensure IV is in linear part of the skb to avoid BUG() due to OOB access (diff)
downloadkernel-qcow2-linux-8eeee8b152ae6bbe181518efaf62ba8e9c613693.tar.gz
kernel-qcow2-linux-8eeee8b152ae6bbe181518efaf62ba8e9c613693.tar.xz
kernel-qcow2-linux-8eeee8b152ae6bbe181518efaf62ba8e9c613693.zip
[NETFILTER]: Replate direct proc_fops assignment with proc_create call.
This elliminates infamous race during module loading when one could lookup proc entry without proc_fops assigned. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nfnetlink_queue.c')
-rw-r--r--net/netfilter/nfnetlink_queue.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 012cb6910820..10522c04ed24 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -896,9 +896,6 @@ static const struct file_operations nfqnl_file_ops = {
static int __init nfnetlink_queue_init(void)
{
int i, status = -ENOMEM;
-#ifdef CONFIG_PROC_FS
- struct proc_dir_entry *proc_nfqueue;
-#endif
for (i = 0; i < INSTANCE_BUCKETS; i++)
INIT_HLIST_HEAD(&instance_table[i]);
@@ -911,11 +908,9 @@ static int __init nfnetlink_queue_init(void)
}
#ifdef CONFIG_PROC_FS
- proc_nfqueue = create_proc_entry("nfnetlink_queue", 0440,
- proc_net_netfilter);
- if (!proc_nfqueue)
+ if (!proc_create("nfnetlink_queue", 0440,
+ proc_net_netfilter, &nfqnl_file_ops))
goto cleanup_subsys;
- proc_nfqueue->proc_fops = &nfqnl_file_ops;
#endif
register_netdevice_notifier(&nfqnl_dev_notifier);