Skip to contentSkip to conversation

check if CTA_PROTOINFO_TCP is present

PATCH In review Pablo Neira 1 participant 1 message Nov 4, 2005

Subsystems (2)
lore
Share & tools
lore

Pablo Neira

author maintainer
#0 lore raw

PATCH 2/7 check if CTA_PROTOINFO_TCP 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.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

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.

net/ipv4/netfilter/ip_conntrack_proto_tcp.c +5 -0
Index: net-2.6.git/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
===================================================================
@@ -362,6 +362,11 @@ static int nfattr_to_tcp(struct nfattr *
 	struct nfattr *attr = cda[CTA_PROTOINFO_TCP-1];
 	struct nfattr *tb[CTA_PROTOINFO_TCP_MAX];
 
+	/* updates could not contain anything about the private 
+	 * protocol info, in that case skip the parsing. */
+	if (!attr)
+		return 0;
+
         if (nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr) < 0)
                 goto nfattr_failure;