]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] Fix IPCOMP crashes.
authorPatrick McHardy <kaber@trash.net>
Wed, 18 Jul 2007 09:26:27 +0000 (02:26 -0700)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Aug 2007 15:23:56 +0000 (17:23 +0200)
[XFRM]: Fix crash introduced by struct dst_entry reordering

XFRM expects xfrm_dst->u.next to be same pointer as dst->next, which
was broken by the dst_entry reordering in commit 1e19e02c~, causing
an oops in xfrm_bundle_ok when walking the bundle upwards.

Kill xfrm_dst->u.next and change the only user to use dst->next instead.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/net/xfrm.h
net/xfrm/xfrm_policy.c

index e4765413cf80c7ee9a5f4997796f6ee7ef93a206..4fc943b71f840320dccb9b116a0eee02c9706caa 100644 (file)
@@ -561,7 +561,6 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct
 struct xfrm_dst
 {
        union {
-               struct xfrm_dst         *next;
                struct dst_entry        dst;
                struct rtable           rt;
                struct rt6_info         rt6;
index 9704e05f69c835dc9244e509c6b2864b08e31830..c208a8a54ce85e6710e5b83bf8271f0736f348fd 100644 (file)
@@ -1971,7 +1971,7 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first,
                if (last == first)
                        break;
 
-               last = last->u.next;
+               last = (struct xfrm_dst *)last->u.dst.next;
                last->child_mtu_cached = mtu;
        }