Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

src: Fix panic of SADB when the state of sav is changed in timeout



details:   https://anonhg.NetBSD.org/src/rev/b9b58748901c
branches:  trunk
changeset: 318261:b9b58748901c
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Tue Apr 17 04:22:58 2018 +0000
description:
Fix panic of SADB when the state of sav is changed in timeout

pointed out by ozaki-r@n.o, thanks

diffstat:

 sys/netipsec/key.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 14880aa3b877 -r b9b58748901c sys/netipsec/key.c
--- a/sys/netipsec/key.c        Tue Apr 17 02:03:56 2018 +0000
+++ b/sys/netipsec/key.c        Tue Apr 17 04:22:58 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key.c,v 1.252 2018/04/16 08:56:08 yamaguchi Exp $      */
+/*     $NetBSD: key.c,v 1.253 2018/04/17 04:22:58 yamaguchi Exp $      */
 /*     $FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $        */
 /*     $KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $   */
 
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.252 2018/04/16 08:56:08 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.253 2018/04/17 04:22:58 yamaguchi Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -418,6 +418,8 @@
        PSLIST_READER_NEXT((sav), struct secasvar, pslist_entry)
 
 /* Macros for key_sad.savlut */
+#define SAVLUT_ENTRY_INIT(sav)                                         \
+       PSLIST_ENTRY_INIT((sav), pslist_entry_savlut)
 #define SAVLUT_READER_FOREACH(sav, dst, proto, hash_key)               \
        PSLIST_READER_FOREACH((sav),                                    \
        &key_sad.savlut[key_savluthash(dst, proto, hash_key,            \
@@ -1432,6 +1434,7 @@
 
        localcount_init(&sav->localcount);
        SAVLIST_ENTRY_INIT(sav);
+       SAVLUT_ENTRY_INIT(sav);
 }
 
 u_int



Home | Main Index | Thread Index | Old Index