netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPSEC] Missing unlock in policy timer
@ 2004-07-23 11:06 Herbert Xu
  2004-07-23 20:34 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Herbert Xu @ 2004-07-23 11:06 UTC (permalink / raw)
  To: David S. Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

Hi Dave:

This is one of those cases where the cure is worse than the disease :)
I added read locks in the policy timer to close an unlikely race, but
I missed an unlock on the expire path which leads to all sort of weird
things.

I'll stay away from the timers for a while :)

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[-- Attachment #2: p --]
[-- Type: text/plain, Size: 322 bytes --]

===== net/xfrm/xfrm_policy.c 1.51 vs edited =====
--- 1.51/net/xfrm/xfrm_policy.c	2004-05-30 05:45:43 +10:00
+++ edited/net/xfrm/xfrm_policy.c	2004-07-23 21:00:52 +10:00
@@ -204,6 +204,7 @@
 	return;
 
 expired:
+	read_unlock(&xp->lock);
 	km_policy_expired(xp, dir, 1);
 	xfrm_policy_delete(xp, dir);
 	xfrm_pol_put(xp);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [IPSEC] Missing unlock in policy timer
  2004-07-23 11:06 [IPSEC] Missing unlock in policy timer Herbert Xu
@ 2004-07-23 20:34 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-07-23 20:34 UTC (permalink / raw)
  To: Herbert Xu; +Cc: netdev

On Fri, 23 Jul 2004 21:06:26 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> This is one of those cases where the cure is worse than the disease :)
> I added read locks in the policy timer to close an unlikely race, but
> I missed an unlock on the expire path which leads to all sort of weird
> things.
> 
> I'll stay away from the timers for a while :)

Hehe, applied.  Thanks Herbert.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-23 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-23 11:06 [IPSEC] Missing unlock in policy timer Herbert Xu
2004-07-23 20:34 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).