summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorknakahara <knakahara@NetBSD.org>2018-04-27 09:55:27 +0000
committerknakahara <knakahara@NetBSD.org>2018-04-27 09:55:27 +0000
commit18fca0ec9dd3f22d91ed6f3ea439bb10079b95fc (patch)
treefcb7e674be97fe20435bf81ffc07e0e6396366b6 /sys/net
parente1a33915daf541876ca6627845271f17a0589e0d (diff)
Fix LOCKDEBUG kernel panic when many(about 200) tunnel interfaces is created.
The tunnel interfaces are gif(4), l2tp(4), and ipsecif(4). They use mutex itself in percpu area. When percpu_cpu_enlarge() run, the address of the mutex in percpu area becomes different from the address which lockdebug saved. That can cause "already initialized" false detection.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_gif.c8
-rw-r--r--sys/net/if_gif.h4
-rw-r--r--sys/net/if_ipsec.c8
-rw-r--r--sys/net/if_ipsec.h4
-rw-r--r--sys/net/if_l2tp.c8
-rw-r--r--sys/net/if_l2tp.h4
6 files changed, 18 insertions, 18 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 34522408519..488ce204636 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gif.c,v 1.139 2018/02/12 15:38:14 maxv Exp $ */
+/* $NetBSD: if_gif.c,v 1.140 2018/04/27 09:55:27 knakahara Exp $ */
/* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.139 2018/02/12 15:38:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.140 2018/04/27 09:55:27 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -319,7 +319,7 @@ gif_ro_init_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
{
struct gif_ro *gro = p;
- mutex_init(&gro->gr_lock, MUTEX_DEFAULT, IPL_NONE);
+ gro->gr_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
}
static void
@@ -329,7 +329,7 @@ gif_ro_fini_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
rtcache_free(&gro->gr_ro);
- mutex_destroy(&gro->gr_lock);
+ mutex_obj_free(gro->gr_lock);
}
void
diff --git a/sys/net/if_gif.h b/sys/net/if_gif.h
index d55761fafcc..1fc3e95c230 100644
--- a/sys/net/if_gif.h
+++ b/sys/net/if_gif.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gif.h,v 1.30 2018/04/19 21:20:43 christos Exp $ */
+/* $NetBSD: if_gif.h,v 1.31 2018/04/27 09:55:27 knakahara Exp $ */
/* $KAME: if_gif.h,v 1.23 2001/07/27 09:21:42 itojun Exp $ */
/*
@@ -56,7 +56,7 @@ struct encaptab;
struct gif_ro {
struct route gr_ro;
- kmutex_t gr_lock;
+ kmutex_t *gr_lock;
};
struct gif_variant {
diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c
index 27330fc0e2a..ce1023d9e84 100644
--- a/sys/net/if_ipsec.c
+++ b/sys/net/if_ipsec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ipsec.c,v 1.12 2018/04/27 00:06:40 knakahara Exp $ */
+/* $NetBSD: if_ipsec.c,v 1.13 2018/04/27 09:55:27 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.12 2018/04/27 00:06:40 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.13 2018/04/27 09:55:27 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -220,7 +220,7 @@ if_ipsec_ro_init_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
{
struct ipsec_ro *iro = p;
- mutex_init(&iro->ir_lock, MUTEX_DEFAULT, IPL_NONE);
+ iro->ir_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
}
static void
@@ -230,7 +230,7 @@ if_ipsec_ro_fini_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
rtcache_free(&iro->ir_ro);
- mutex_destroy(&iro->ir_lock);
+ mutex_obj_free(iro->ir_lock);
}
static int
diff --git a/sys/net/if_ipsec.h b/sys/net/if_ipsec.h
index 09dcd541fae..0305ad88c08 100644
--- a/sys/net/if_ipsec.h
+++ b/sys/net/if_ipsec.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ipsec.h,v 1.2 2018/04/19 21:20:43 christos Exp $ */
+/* $NetBSD: if_ipsec.h,v 1.3 2018/04/27 09:55:27 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -87,7 +87,7 @@ struct ipsec_variant {
struct ipsec_ro {
struct route ir_ro;
- kmutex_t ir_lock;
+ kmutex_t *ir_lock;
};
struct ipsec_softc {
diff --git a/sys/net/if_l2tp.c b/sys/net/if_l2tp.c
index b9cc08ed92c..ac61fdca8ff 100644
--- a/sys/net/if_l2tp.c
+++ b/sys/net/if_l2tp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_l2tp.c,v 1.23 2018/04/10 11:44:13 knakahara Exp $ */
+/* $NetBSD: if_l2tp.c,v 1.24 2018/04/27 09:55:27 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.23 2018/04/10 11:44:13 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.24 2018/04/27 09:55:27 knakahara Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -298,7 +298,7 @@ l2tp_ro_init_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
{
struct l2tp_ro *lro = p;
- mutex_init(&lro->lr_lock, MUTEX_DEFAULT, IPL_NONE);
+ lro->lr_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
}
void
@@ -308,7 +308,7 @@ l2tp_ro_fini_pc(void *p, void *arg __unused, struct cpu_info *ci __unused)
rtcache_free(&lro->lr_ro);
- mutex_destroy(&lro->lr_lock);
+ mutex_obj_free(lro->lr_lock);
}
static int
diff --git a/sys/net/if_l2tp.h b/sys/net/if_l2tp.h
index 45943b5dc27..465842e0f2e 100644
--- a/sys/net/if_l2tp.h
+++ b/sys/net/if_l2tp.h
@@ -1,4 +1,4 @@
-/* $NetBSD: if_l2tp.h,v 1.4 2018/04/19 21:20:43 christos Exp $ */
+/* $NetBSD: if_l2tp.h,v 1.5 2018/04/27 09:55:27 knakahara Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -92,7 +92,7 @@ struct l2tp_variant {
struct l2tp_ro {
struct route lr_ro;
- kmutex_t lr_lock;
+ kmutex_t *lr_lock;
};
struct l2tp_softc {