check if CTA_PROTOINFO_TCP is present
Subsystems (2)
Pablo Neira
maintainerPATCH 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.
Signed-out-by Pablo Neira Ayuso <[email protected]>
net/ipv4/netfilter/ip_conntrack_proto_tcp.c +5 -0
@@ -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;