aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2005-11-09 15:59:41 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-09 15:59:41 -0500
commit51df784ed739246a3774b300e5f536e17bec36ed (patch)
tree866c76ffab5fa6c19648829f46dfcaee6f314a7d /net/ipv4
parenta2506c04322ca266fe2f9bd7d02a67b1972da611 (diff)
[NETFILTER] ctnetlink: check if protoinfo is present
This fixes an oops triggered from userspace. If we don't pass information about the private protocol info, the reference to attr will be NULL. This is likely to happen in update messages. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/ip_conntrack_proto_tcp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index 6ea4b22ff28d..468c6003b4c7 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -362,6 +362,11 @@ static int nfattr_to_tcp(struct nfattr *cda[], struct ip_conntrack *ct)
362 struct nfattr *attr = cda[CTA_PROTOINFO_TCP-1]; 362 struct nfattr *attr = cda[CTA_PROTOINFO_TCP-1];
363 struct nfattr *tb[CTA_PROTOINFO_TCP_MAX]; 363 struct nfattr *tb[CTA_PROTOINFO_TCP_MAX];
364 364
365 /* updates could not contain anything about the private
366 * protocol info, in that case skip the parsing */
367 if (!attr)
368 return 0;
369
365 nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr); 370 nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr);
366 371
367 if (!tb[CTA_PROTOINFO_TCP_STATE-1]) 372 if (!tb[CTA_PROTOINFO_TCP_STATE-1])