/[linux-patches]/genpatches-2.6/trunk/2.6.14/1135_3_netfilter-refcount-leak.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1135_3_netfilter-refcount-leak.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 292 - (show annotations) (download) (as text)
Tue Jan 31 21:50:53 2006 UTC (14 years, 10 months ago) by johnm
File MIME type: text/x-diff
File size: 1359 byte(s)
Large update - thanks goes to Kerin Millar for the legwork.
1 From stable-bounces@linux.kernel.org Tue Nov 15 04:32:52 2005
2 Date: Tue, 15 Nov 2005 13:32:36 +0100
3 From: Harald Welte <laforge@netfilter.org>
4 To: Stable Kernel <stable@kernel.org>
5 Cc:
6 Subject: [PATCH] [NETFILTER] refcount leak of proto when ctnetlink dumping tuple
7
8 From: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
9
10 Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
11 Signed-off-by: Harald Welte <laforge@netfilter.org>
12 Signed-off-by: Chris Wright <chrisw@osdl.org>
13 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 ---
15 net/ipv4/netfilter/ip_conntrack_netlink.c | 9 ++++++---
16 1 file changed, 6 insertions(+), 3 deletions(-)
17
18 --- linux-2.6.14.2.orig/net/ipv4/netfilter/ip_conntrack_netlink.c
19 +++ linux-2.6.14.2/net/ipv4/netfilter/ip_conntrack_netlink.c
20 @@ -58,14 +58,17 @@ ctnetlink_dump_tuples_proto(struct sk_bu
21 const struct ip_conntrack_tuple *tuple)
22 {
23 struct ip_conntrack_protocol *proto;
24 + int ret = 0;
25
26 NFA_PUT(skb, CTA_PROTO_NUM, sizeof(u_int8_t), &tuple->dst.protonum);
27
28 proto = ip_conntrack_proto_find_get(tuple->dst.protonum);
29 - if (proto && proto->tuple_to_nfattr)
30 - return proto->tuple_to_nfattr(skb, tuple);
31 + if (likely(proto && proto->tuple_to_nfattr)) {
32 + ret = proto->tuple_to_nfattr(skb, tuple);
33 + ip_conntrack_proto_put(proto);
34 + }
35
36 - return 0;
37 + return ret;
38
39 nfattr_failure:
40 return -1;

  ViewVC Help
Powered by ViewVC 1.1.20