/[linux-patches]/genpatches-2.6/trunk/2.6.14/1161_5_ctnetlink-read_unlock_bh.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1161_5_ctnetlink-read_unlock_bh.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, 9 months ago) by johnm
File MIME type: text/x-diff
File size: 1312 byte(s)
Large update - thanks goes to Kerin Millar for the legwork.
1 From: Patrick McHardy <kaber@trash.net>
2 Date: Tue, 13 Dec 2005 11:26:07 +0000 (+0100)
3 Subject: [PATCH] Fix unbalanced read_unlock_bh in ctnetlink
4 X-Git-Url: http://kernel.org/git/?p=linux/kernel/git/gregkh/linux-2.6.14.y.git;a=commitdiff;h=b72c1d0c14634506a2ff740033ab1bda3c3d5d7f
5
6 [PATCH] Fix unbalanced read_unlock_bh in ctnetlink
7
8 NFA_NEST calls NFA_PUT which jumps to nfattr_failure if the skb has no
9 room left. We call read_unlock_bh at nfattr_failure for the NFA_PUT
10 inside the locked section, so move NFA_NEST inside the locked section
11 too.
12
13 Signed-off-by: Patrick McHardy <kaber@trash.net>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 Signed-off-by: Krzysztof Piotr Oledzki <ole@ans.pl>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 ---
18
19 --- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
20 +++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
21 @@ -341,9 +341,10 @@ static int tcp_print_conntrack(struct se
22 static int tcp_to_nfattr(struct sk_buff *skb, struct nfattr *nfa,
23 const struct ip_conntrack *ct)
24 {
25 - struct nfattr *nest_parms = NFA_NEST(skb, CTA_PROTOINFO_TCP);
26 + struct nfattr *nest_parms;
27
28 read_lock_bh(&tcp_lock);
29 + nest_parms = NFA_NEST(skb, CTA_PROTOINFO_TCP);
30 NFA_PUT(skb, CTA_PROTOINFO_TCP_STATE, sizeof(u_int8_t),
31 &ct->proto.tcp.state);
32 read_unlock_bh(&tcp_lock);

  ViewVC Help
Powered by ViewVC 1.1.20