From owner-freebsd-net@freebsd.org Sun Oct 4 20:32:35 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E905EA0E08D for ; Sun, 4 Oct 2015 20:32:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id CDE261EAA for ; Sun, 4 Oct 2015 20:32:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id CA083A0E08C; Sun, 4 Oct 2015 20:32:34 +0000 (UTC) Delivered-To: net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB30A0E08B for ; Sun, 4 Oct 2015 20:32:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9994A1EA8; Sun, 4 Oct 2015 20:32:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 3BB4A1D3C; Sun, 4 Oct 2015 20:32:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: Page fault after destroying/reconfiguring GRE interface To: Julian Kornberger , "net@freebsd.org" References: <56106056.7040006@tzi.de> From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <56118C9A.7080303@FreeBSD.org> Date: Sun, 4 Oct 2015 23:31:22 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56106056.7040006@tzi.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iiD4qLXNv0UkHNqWAkBqPiPCmd9pbWjpD" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2015 20:32:35 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iiD4qLXNv0UkHNqWAkBqPiPCmd9pbWjpD Content-Type: multipart/mixed; boundary="------------050806010300050009010003" This is a multi-part message in MIME format. --------------050806010300050009010003 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 04.10.2015 02:10, Julian Kornberger wrote: > my machine (FreeBSD 10.2) crashes sometimes after I destroy or > reconfigure a GRE interface. You find my crash dumps at: > http://www.informatik.uni-bremen.de/~juliank/crash/ >=20 > [...] > #7 0xffffffff80d307f2 in calltrap () > at /usr/src/sys/amd64/amd64/exception.S:236 > #8 0xffffffff81e125eb in in_gre_encapcheck (m=3D0xfffff8001ef81d00, of= f=3D20, > proto=3D47, arg=3D0xfffff800613f3000) > at /usr/src/sys/modules/if_gre/../../netinet/ip_gre.c:112 > #9 0xffffffff80a75142 in encap4_input (m=3D0xfffff8001ef81d00, off=3D2= 0) > at /usr/src/sys/netinet/ip_encap.c:149 > #10 0xffffffff80a77f57 in ip_input (m=3D0xfffff8001ef81d00) > at /usr/src/sys/netinet/ip_input.c:734 > [...] >=20 > Any ideas? Can you test this patch? --=20 WBR, Andrey V. Elsukov --------------050806010300050009010003 Content-Type: text/x-patch; name="ip_encap.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ip_encap.diff" Index: sys/netinet/ip_encap.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/netinet/ip_encap.c (revision 287393) +++ sys/netinet/ip_encap.c (working copy) @@ -181,7 +181,6 @@ encap4_input(struct mbuf *m, int off) match =3D ep; } } - mtx_unlock(&encapmtx); =20 if (match) { /* found a match, "match" has the best one */ @@ -191,8 +190,10 @@ encap4_input(struct mbuf *m, int off) (*psw->pr_input)(m, off); } else m_freem(m); + mtx_unlock(&encapmtx); return; - } + } else + mtx_unlock(&encapmtx); =20 /* last resort: inject to raw socket */ rip_input(m, off); @@ -255,12 +256,15 @@ encap6_input(struct mbuf **mp, int *offp, int prot psw =3D (const struct ip6protosw *)match->psw; if (psw && psw->pr_input) { encap_fillarg(m, match); - return (*psw->pr_input)(mp, offp, proto); + prio =3D (*psw->pr_input)(mp, offp, proto); } else { m_freem(m); - return IPPROTO_DONE; + prio =3D IPPROTO_DONE; } - } + mtx_unlock(&encapmtx); + return (prio); + } else + mtx_unlock(&encapmtx); =20 /* last resort: inject to raw socket */ return rip6_input(mp, offp, proto); --------------050806010300050009010003-- --iiD4qLXNv0UkHNqWAkBqPiPCmd9pbWjpD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWEYyaAAoJEAHF6gQQyKF6Z3EH/10X2yd1QqdkR6RFshgnAOIV pYFLkxKrwF/rp5oK/+VJXQAVTNChgN9uhVe0Aym3aXv20T1WsTXQlBQpCtbB2/9I 2TIbWrR/z6b+P5Qq8JFEYXTRaKuSCOD50pr/3o/uwT8KbdOuJ15w4VucwOgz2kHY 76W/6+xZ1S779wQU4ZV/VaX+tcijShIdwVZRRTqOD2LwWekf2ZxTRC74Ntm1BHw0 GBfL4d/c2bgPQ3An0f3cxaL5EYSH7X2RqHngxg+jnzrzLyYxqO82OoubpS5aeXyO GfzlLrzx0pCcj0FDzyfyyvG+G+Vr91TS+68l4nR7o25qzVNpm1cx4qpvqzbTVKA= =/f12 -----END PGP SIGNATURE----- --iiD4qLXNv0UkHNqWAkBqPiPCmd9pbWjpD--