aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-07-22 17:32:39 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-22 17:32:39 -0400
commit7bd04bcf91e77bd0fe01c180546aacab4c7934be (patch)
treeac8a84f1ab026998dfae0f95f0057756cc650681
parentf5f7ab6785ec15b8b95750c0dd590ca3aeb49248 (diff)
parentbaf60efa585c78b269f0097288868a51ccc61f55 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says: ==================== The following patchset contains Netfilter fixes for your net tree, they are: * Fix potential NULL dereference in the socket match if revision 0 is used, from Eric Dumazet. * Fix missing expectation NAT initialization that results in dumping the NAT part via ctnetlink, thus leading to problems in expectation synchronization through conntrackd, from myself. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/nf_conntrack_expect.c5
-rw-r--r--net/netfilter/xt_socket.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index c63b618cd619..4fd1ca94fd4a 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -293,6 +293,11 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,
293 sizeof(exp->tuple.dst.u3) - len); 293 sizeof(exp->tuple.dst.u3) - len);
294 294
295 exp->tuple.dst.u.all = *dst; 295 exp->tuple.dst.u.all = *dst;
296
297#ifdef CONFIG_NF_NAT_NEEDED
298 memset(&exp->saved_addr, 0, sizeof(exp->saved_addr));
299 memset(&exp->saved_proto, 0, sizeof(exp->saved_proto));
300#endif
296} 301}
297EXPORT_SYMBOL_GPL(nf_ct_expect_init); 302EXPORT_SYMBOL_GPL(nf_ct_expect_init);
298 303
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index f8b71911037a..20b15916f403 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -172,7 +172,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,
172 172
173 /* Ignore non-transparent sockets, 173 /* Ignore non-transparent sockets,
174 if XT_SOCKET_TRANSPARENT is used */ 174 if XT_SOCKET_TRANSPARENT is used */
175 if (info && info->flags & XT_SOCKET_TRANSPARENT) 175 if (info->flags & XT_SOCKET_TRANSPARENT)
176 transparent = ((sk->sk_state != TCP_TIME_WAIT && 176 transparent = ((sk->sk_state != TCP_TIME_WAIT &&
177 inet_sk(sk)->transparent) || 177 inet_sk(sk)->transparent) ||
178 (sk->sk_state == TCP_TIME_WAIT && 178 (sk->sk_state == TCP_TIME_WAIT &&
@@ -196,7 +196,11 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,
196static bool 196static bool
197socket_mt4_v0(const struct sk_buff *skb, struct xt_action_param *par) 197socket_mt4_v0(const struct sk_buff *skb, struct xt_action_param *par)
198{ 198{
199 return socket_match(skb, par, NULL); 199 static struct xt_socket_mtinfo1 xt_info_v0 = {
200 .flags = 0,
201 };
202
203 return socket_match(skb, par, &xt_info_v0);
200} 204}
201 205
202static bool 206static bool
@@ -314,7 +318,7 @@ socket_mt6_v1_v2(const struct sk_buff *skb, struct xt_action_param *par)
314 318
315 /* Ignore non-transparent sockets, 319 /* Ignore non-transparent sockets,
316 if XT_SOCKET_TRANSPARENT is used */ 320 if XT_SOCKET_TRANSPARENT is used */
317 if (info && info->flags & XT_SOCKET_TRANSPARENT) 321 if (info->flags & XT_SOCKET_TRANSPARENT)
318 transparent = ((sk->sk_state != TCP_TIME_WAIT && 322 transparent = ((sk->sk_state != TCP_TIME_WAIT &&
319 inet_sk(sk)->transparent) || 323 inet_sk(sk)->transparent) ||
320 (sk->sk_state == TCP_TIME_WAIT && 324 (sk->sk_state == TCP_TIME_WAIT &&