diff options
| author | knakahara <knakahara@NetBSD.org> | 2018-04-27 09:55:27 +0000 |
|---|---|---|
| committer | knakahara <knakahara@NetBSD.org> | 2018-04-27 09:55:27 +0000 |
| commit | 18fca0ec9dd3f22d91ed6f3ea439bb10079b95fc (patch) | |
| tree | fcb7e674be97fe20435bf81ffc07e0e6396366b6 /sys/netinet | |
| parent | e1a33915daf541876ca6627845271f17a0589e0d (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/netinet')
| -rw-r--r-- | sys/netinet/in_gif.c | 12 | ||||
| -rw-r--r-- | sys/netinet/in_l2tp.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 631d991faa3..120138907bd 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -1,4 +1,4 @@ -/* $NetBSD: in_gif.c,v 1.92 2018/01/10 11:13:26 knakahara Exp $ */ +/* $NetBSD: in_gif.c,v 1.93 2018/04/27 09:55:28 knakahara Exp $ */ /* $KAME: in_gif.c,v 1.66 2001/07/29 04:46:09 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.92 2018/01/10 11:13:26 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in_gif.c,v 1.93 2018/04/27 09:55:28 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -176,10 +176,10 @@ in_gif_output(struct gif_variant *var, int family, struct mbuf *m) sc = var->gv_softc; gro = percpu_getref(sc->gif_ro_percpu); - mutex_enter(&gro->gr_lock); + mutex_enter(gro->gr_lock); ro = &gro->gr_ro; if ((rt = rtcache_lookup(ro, var->gv_pdst)) == NULL) { - mutex_exit(&gro->gr_lock); + mutex_exit(gro->gr_lock); percpu_putref(sc->gif_ro_percpu); m_freem(m); return ENETUNREACH; @@ -189,7 +189,7 @@ in_gif_output(struct gif_variant *var, int family, struct mbuf *m) if (rt->rt_ifp == ifp) { rtcache_unref(rt, ro); rtcache_free(ro); - mutex_exit(&gro->gr_lock); + mutex_exit(gro->gr_lock); percpu_putref(sc->gif_ro_percpu); m_freem(m); return ENETUNREACH; /*XXX*/ @@ -197,7 +197,7 @@ in_gif_output(struct gif_variant *var, int family, struct mbuf *m) rtcache_unref(rt, ro); error = ip_output(m, NULL, ro, 0, NULL, NULL); - mutex_exit(&gro->gr_lock); + mutex_exit(gro->gr_lock); percpu_putref(sc->gif_ro_percpu); return (error); } diff --git a/sys/netinet/in_l2tp.c b/sys/netinet/in_l2tp.c index 397413af564..819297c9d9d 100644 --- a/sys/netinet/in_l2tp.c +++ b/sys/netinet/in_l2tp.c @@ -1,4 +1,4 @@ -/* $NetBSD: in_l2tp.c,v 1.12 2018/01/26 07:49:15 maxv Exp $ */ +/* $NetBSD: in_l2tp.c,v 1.13 2018/04/27 09:55:28 knakahara Exp $ */ /* * Copyright (c) 2017 Internet Initiative Japan Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.12 2018/01/26 07:49:15 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in_l2tp.c,v 1.13 2018/04/27 09:55:28 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_l2tp.h" @@ -209,9 +209,9 @@ in_l2tp_output(struct l2tp_variant *var, struct mbuf *m) memcpy(mtod(m, struct ip *), &iphdr, sizeof(struct ip)); lro = percpu_getref(sc->l2tp_ro_percpu); - mutex_enter(&lro->lr_lock); + mutex_enter(lro->lr_lock); if ((rt = rtcache_lookup(&lro->lr_ro, var->lv_pdst)) == NULL) { - mutex_exit(&lro->lr_lock); + mutex_exit(lro->lr_lock); percpu_putref(sc->l2tp_ro_percpu); m_freem(m); error = ENETUNREACH; @@ -221,7 +221,7 @@ in_l2tp_output(struct l2tp_variant *var, struct mbuf *m) if (rt->rt_ifp == ifp) { rtcache_unref(rt, &lro->lr_ro); rtcache_free(&lro->lr_ro); - mutex_exit(&lro->lr_lock); + mutex_exit(lro->lr_lock); percpu_putref(sc->l2tp_ro_percpu); m_freem(m); error = ENETUNREACH; /*XXX*/ @@ -236,7 +236,7 @@ in_l2tp_output(struct l2tp_variant *var, struct mbuf *m) m->m_pkthdr.csum_flags = 0; error = ip_output(m, NULL, &lro->lr_ro, 0, NULL, NULL); - mutex_exit(&lro->lr_lock); + mutex_exit(lro->lr_lock); percpu_putref(sc->l2tp_ro_percpu); return error; |
