diff options
author | Michal Kubeček <mkubecek@suse.cz> | 2013-09-11 04:17:27 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-09-13 05:58:40 -0400 |
commit | c13a84a830a208fb3443628773c8ca0557773cc7 (patch) | |
tree | 9d1c7a2d6e73a7bcb9af3b753eeccac73c43b47a /include | |
parent | c19d65c95c6d472d69829fea7d473228493d5245 (diff) |
netfilter: nf_conntrack: use RCU safe kfree for conntrack extensions
Commit 68b80f11 (netfilter: nf_nat: fix RCU races) introduced
RCU protection for freeing extension data when reallocation
moves them to a new location. We need the same protection when
freeing them in nf_ct_ext_free() in order to prevent a
use-after-free by other threads referencing a NAT extension data
via bysource list.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/netfilter/nf_conntrack_extend.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index ff95434e50ca..88a1d4060d52 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -86,7 +86,7 @@ static inline void nf_ct_ext_destroy(struct nf_conn *ct) | |||
86 | static inline void nf_ct_ext_free(struct nf_conn *ct) | 86 | static inline void nf_ct_ext_free(struct nf_conn *ct) |
87 | { | 87 | { |
88 | if (ct->ext) | 88 | if (ct->ext) |
89 | kfree(ct->ext); | 89 | kfree_rcu(ct->ext, rcu); |
90 | } | 90 | } |
91 | 91 | ||
92 | /* Add this type, returns pointer to data or NULL. */ | 92 | /* Add this type, returns pointer to data or NULL. */ |