]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.29.5/xfrm-wrong-hash-value-for-temporary-sa.patch
Drop watchdog patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.29.5 / xfrm-wrong-hash-value-for-temporary-sa.patch
CommitLineData
15569d91
GKH
1From 5ad8585fef1612245f19245a418482adefef4601 Mon Sep 17 00:00:00 2001
2From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
3Date: Mon, 27 Apr 2009 02:58:59 -0700
4Subject: xfrm: wrong hash value for temporary SA
5
6From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
7
8[ Upstream commit 6a783c9067e3f71aac61a9262fe42c1f68efd4fc ]
9
10When kernel inserts a temporary SA for IKE, it uses the wrong hash
11value for dst list. Two hash values were calcultated before: one with
12source address and one with a wildcard source address.
13
14Bug hinted by Junwei Zhang <junwei.zhang@6wind.com>
15Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
16Signed-off-by: David S. Miller <davem@davemloft.net>
17Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18
19---
20 net/xfrm/xfrm_state.c | 6 +++---
21 1 file changed, 3 insertions(+), 3 deletions(-)
22
23--- a/net/xfrm/xfrm_state.c
24+++ b/net/xfrm/xfrm_state.c
25@@ -794,7 +794,7 @@ xfrm_state_find(xfrm_address_t *daddr, x
26 {
27 static xfrm_address_t saddr_wildcard = { };
28 struct net *net = xp_net(pol);
29- unsigned int h;
30+ unsigned int h, h_wildcard;
31 struct hlist_node *entry;
32 struct xfrm_state *x, *x0, *to_put;
33 int acquire_in_progress = 0;
34@@ -819,8 +819,8 @@ xfrm_state_find(xfrm_address_t *daddr, x
35 if (best)
36 goto found;
37
38- h = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, family);
39- hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h, bydst) {
40+ h_wildcard = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, family);
41+ hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h_wildcard, bydst) {
42 if (x->props.family == family &&
43 x->props.reqid == tmpl->reqid &&
44 !(x->props.flags & XFRM_STATE_WILDRECV) &&