| From stable-bounces@linux.kernel.org Tue Nov 15 04:33:16 2005 |
| Date: Tue, 15 Nov 2005 13:32:36 +0100 |
| From: Harald Welte <laforge@netfilter.org> |
| To: Stable Kernel <stable@kernel.org> |
| Cc: |
| Subject: [PATCH] [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: Chris Wright <chrisw@osdl.org> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
| --- |
| net/ipv4/netfilter/ip_conntrack_proto_tcp.c | 5 +++++ |
| 1 file changed, 5 insertions(+) |
| |
| --- linux-2.6.14.2.orig/net/ipv4/netfilter/ip_conntrack_proto_tcp.c |
| +++ linux-2.6.14.2/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; |
| |