Commit 07919126 authored by Sun Jian's avatar Sun Jian Committed by Florian Westphal
Browse files

netfilter: annotate NAT helper hook pointers with __rcu



The NAT helper hook pointers are updated and dereferenced under RCU rules,
but lack the proper __rcu annotation.

This makes sparse report address space mismatches when the hooks are used
with rcu_dereference().

Add the missing __rcu annotations to the global hook pointer declarations
and definitions in Amanda, FTP, IRC, SNMP and TFTP.

No functional change intended.

Suggested-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarSun Jian <sun.jian.kdev@gmail.com>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
parent 77c5e3fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
#include <linux/skbuff.h>
#include <net/netfilter/nf_conntrack_expect.h>

extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
extern unsigned int (__rcu *nf_nat_amanda_hook)(struct sk_buff *skb,
					  enum ip_conntrack_info ctinfo,
					  unsigned int protoff,
					  unsigned int matchoff,
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ struct nf_ct_ftp_master {

/* For NAT to hook in when we find a packet which describes what other
 * connection we should expect. */
extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
extern unsigned int (__rcu *nf_nat_ftp_hook)(struct sk_buff *skb,
				       enum ip_conntrack_info ctinfo,
				       enum nf_ct_ftp_type type,
				       unsigned int protoff,
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@

#define IRC_PORT	6667

extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
extern unsigned int (__rcu *nf_nat_irc_hook)(struct sk_buff *skb,
				       enum ip_conntrack_info ctinfo,
				       unsigned int protoff,
				       unsigned int matchoff,
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
#include <linux/netfilter.h>
#include <linux/skbuff.h>

extern int (*nf_nat_snmp_hook)(struct sk_buff *skb,
extern int (__rcu *nf_nat_snmp_hook)(struct sk_buff *skb,
				unsigned int protoff,
				struct nf_conn *ct,
				enum ip_conntrack_info ctinfo);
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ struct tftphdr {
#define TFTP_OPCODE_ACK		4
#define TFTP_OPCODE_ERROR	5

extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff *skb,
extern unsigned int (__rcu *nf_nat_tftp_hook)(struct sk_buff *skb,
				        enum ip_conntrack_info ctinfo,
				        struct nf_conntrack_expect *exp);

Loading