netfilter: nf_conntrack: add missing __rcu annotations
authorFlorian Westphal <fw@strlen.de>
Wed, 22 Jun 2022 09:00:45 +0000 (11:00 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 11 Jul 2022 14:25:15 +0000 (16:25 +0200)
Access to the hook pointers use correct helpers but the pointers lack
the needed __rcu annotation.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter/nf_conntrack_sip.h
include/net/netfilter/nf_conntrack_timeout.h
net/netfilter/nf_conntrack_pptp.c
net/netfilter/nf_conntrack_sip.c
net/netfilter/nf_conntrack_timeout.c

index c620521c42bc6932af5350ad264f5d02cb6ccf73..dbc614dfe0d5652f4de9594a3327c9bfabfc4eed 100644 (file)
@@ -164,7 +164,7 @@ struct nf_nat_sip_hooks {
                                  unsigned int medialen,
                                  union nf_inet_addr *rtp_addr);
 };
-extern const struct nf_nat_sip_hooks *nf_nat_sip_hooks;
+extern const struct nf_nat_sip_hooks __rcu *nf_nat_sip_hooks;
 
 int ct_sip_parse_request(const struct nf_conn *ct, const char *dptr,
                         unsigned int datalen, unsigned int *matchoff,
index fea258983d23beb731c25a7674c4676e05603a1e..9fdaba911de64d05ac38f256d0d8445950d13ec5 100644 (file)
@@ -105,7 +105,7 @@ struct nf_ct_timeout_hooks {
        void (*timeout_put)(struct nf_ct_timeout *timeout);
 };
 
-extern const struct nf_ct_timeout_hooks *nf_ct_timeout_hook;
+extern const struct nf_ct_timeout_hooks __rcu *nf_ct_timeout_hook;
 #endif
 
 #endif /* _NF_CONNTRACK_TIMEOUT_H */
index f3fa367b455fb2f28489144752bc9ed689353a8c..4c679638df06b6d44c734a1ab1929b744e684f50 100644 (file)
@@ -45,7 +45,7 @@ MODULE_ALIAS_NFCT_HELPER("pptp");
 
 static DEFINE_SPINLOCK(nf_pptp_lock);
 
-const struct nf_nat_pptp_hook *nf_nat_pptp_hook;
+const struct nf_nat_pptp_hook __rcu *nf_nat_pptp_hook;
 EXPORT_SYMBOL_GPL(nf_nat_pptp_hook);
 
 #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
index b83dc9bf0a5dd00c5cf48f66da86593c718e7b89..a88b43624b2708086af8f234fdead190a4b9097c 100644 (file)
@@ -60,7 +60,7 @@ module_param(sip_external_media, int, 0600);
 MODULE_PARM_DESC(sip_external_media, "Expect Media streams between external "
                                     "endpoints (default 0)");
 
-const struct nf_nat_sip_hooks *nf_nat_sip_hooks;
+const struct nf_nat_sip_hooks __rcu *nf_nat_sip_hooks;
 EXPORT_SYMBOL_GPL(nf_nat_sip_hooks);
 
 static int string_len(const struct nf_conn *ct, const char *dptr,
index 0f828d05ea608e0e70e357a247b2a0ddb345cb41..821365ed5b2c46effebad7035accc6977bd5c0bb 100644 (file)
@@ -22,7 +22,7 @@
 #include <net/netfilter/nf_conntrack_l4proto.h>
 #include <net/netfilter/nf_conntrack_timeout.h>
 
-const struct nf_ct_timeout_hooks *nf_ct_timeout_hook __read_mostly;
+const struct nf_ct_timeout_hooks __rcu *nf_ct_timeout_hook __read_mostly;
 EXPORT_SYMBOL_GPL(nf_ct_timeout_hook);
 
 static int untimeout(struct nf_conn *ct, void *timeout)