Re: [PATCH] IPSec fixes

From: Hajimu UMEMOTO <ume_at_FreeBSD.org>
Date: Fri, 16 Jan 2004 17:12:27 +0900
Hi,

>>>>> On Thu, 15 Jan 2004 22:16:59 +0000 (UTC)
>>>>> bzeeb-lists_at_lists.zabbadoz.net ("Bjoern A. Zeeb") said:

bzeeb-lists> I have built a HEAD kernel from this evening.

bzeeb-lists> crashing the kernel is more easy than booting it...

bzeeb-lists> So the big question at the moment is - why will it not happen if I
bzeeb-lists> remove the unlink call from the spdflush ? What am I missing ?
bzeeb-lists> If anybody has any more ideas please let me know; I will nost likely
bzeeb-lists> not find the time for more debugging until sat eve.

Do you mean that following patch itojun offered doesn't help for you?
It seems fix the problem here.

Index: sys/netkey/key.c
diff -up sys/netkey/key.c.orig sys/netkey/key.c
--- sys/netkey/key.c.orig	Fri Jan 16 17:06:26 2004
+++ sys/netkey/key.c	Fri Jan 16 17:07:38 2004
_at__at_ -1958,7 +1958,6 _at__at_ key_spdadd(so, m, mhp)
 	newsp->lifetime = lft ? lft->sadb_lifetime_addtime : 0;
 	newsp->validtime = lft ? lft->sadb_lifetime_usetime : 0;
 
-	newsp->refcnt = 1;	/* do not reclaim until I say I do */
 	newsp->state = IPSEC_SPSTATE_ALIVE;
 	LIST_INSERT_TAIL(&sptree[newsp->dir], newsp, secpolicy, chain);
 
_at__at_ -7591,9 +7590,10 _at__at_ key_sp_unlink(sp)
 {
 
 	/* remove from SP index */
-	if (__LIST_CHAINED(sp))
+	if (__LIST_CHAINED(sp)) {
 		LIST_REMOVE(sp, chain);
-	key_freesp(sp);
+		key_freesp(sp);
+	}
 }
 
 /* XXX too much? */

Sincerely,

--
Hajimu UMEMOTO _at_ Internet Mutual Aid Society Yokohama, Japan
ume_at_mahoroba.org  ume_at_bisd.hitachi.co.jp  ume_at_{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
Received on Thu Jan 15 2004 - 23:12:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:38 UTC