Skip to contentSkip to conversation

fix bug in spdadd

PATCH Applied Kazunori MIYAZAWA 3 participants 4 messages Feb 14, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix bug in spdadd

This patch fix a BUG when adding spds which have
same selector.

--
Kazunori Miyazawa

net/key/af_key.c +1 -0
index b3ac85e..1c85392 100644
@@ -2291,6 +2291,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
 	return 0;
 
 out:
+	xp->dead = 1;
 	xfrm_policy_destroy(xp);
 	return err;
 }
#1 lore raw

In article <[email protected]> (at Thu, 14 Feb 2008 20:55:40 +0900), Kazunori MIYAZAWA <[email protected]> says:

Quoted 4 lines

This patch fix a BUG when adding spds which have
same selector.

I think we need to fix xfrm_user side as well.

---
[PATCH] [XFRM]: Avoid bogus BUG() when throwing new policy away.

When we destory a new policy entry, we need to tell xfrm_policy_destroy() explicitly that the entry is not alive yet.

---

net/xfrm/xfrm_user.c +1 -0
index 7833807..f971ca5 100644
@@ -1105,6 +1105,7 @@ static struct xfrm_policy *xfrm_policy_construct(struct xfrm_userpolicy_info *p,
 	return xp;
  error:
 	*errp = err;
+	xp->dead = 1;
 	xfrm_policy_destroy(xp);
 	return NULL;
 }
Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
maintainer Applied
#2 lore raw

From: YOSHIFUJI Hideaki / 吉藤英明 <[email protected]>
Date: Fri, 15 Feb 2008 01:54:05 +1100 (EST)

Quoted 5 lines

[PATCH] [XFRM]: Avoid bogus BUG() when throwing new policy away.

When we destory a new policy entry, we need to tell xfrm_policy_destroy() explicitly that the entry is not alive yet.

Applied.

Please provide a proper Signed-off-by: next time.

Thank you!