From owner-svn-src-all@freebsd.org Wed Jan 8 16:15:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5A191F36C6; Wed, 8 Jan 2020 16:15:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47tDr03yZ3z3H8p; Wed, 8 Jan 2020 16:15:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833471A9F2; Wed, 8 Jan 2020 16:15:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 008GFiKp031223; Wed, 8 Jan 2020 16:15:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 008GFigA031221; Wed, 8 Jan 2020 16:15:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001081615.008GFigA031221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 8 Jan 2020 16:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r356492 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 356492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jan 2020 16:15:44 -0000 Author: bz Date: Wed Jan 8 16:15:43 2020 New Revision: 356492 URL: https://svnweb.freebsd.org/changeset/base/356492 Log: MFC r354092: Properly set VNET when nuking recvif from fragment queues. In theory the eventhandler invoke should be in the same VNET as the the current interface. We however cannot guarantee that for all cases in the future. So before checking if the fragmentation handling for this VNET is active, switch the VNET to the VNET of the interface to always get the one we want. Modified: stable/12/sys/netinet/ip_reass.c stable/12/sys/netinet6/frag6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_reass.c ============================================================================== --- stable/12/sys/netinet/ip_reass.c Wed Jan 8 16:14:20 2020 (r356491) +++ stable/12/sys/netinet/ip_reass.c Wed Jan 8 16:15:43 2020 (r356492) @@ -631,14 +631,17 @@ ipreass_cleanup(void *arg __unused, struct ifnet *ifp) KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); + CURVNET_SET_QUIET(ifp->if_vnet); + /* * Skip processing if IPv4 reassembly is not initialised or * torn down by ipreass_destroy(). */ - if (V_ipq_zone == NULL) + if (V_ipq_zone == NULL) { + CURVNET_RESTORE(); return; + } - CURVNET_SET_QUIET(ifp->if_vnet); for (i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); /* Scan fragment list. */ Modified: stable/12/sys/netinet6/frag6.c ============================================================================== --- stable/12/sys/netinet6/frag6.c Wed Jan 8 16:14:20 2020 (r356491) +++ stable/12/sys/netinet6/frag6.c Wed Jan 8 16:15:43 2020 (r356492) @@ -307,16 +307,18 @@ frag6_cleanup(void *arg __unused, struct ifnet *ifp) KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); + CURVNET_SET_QUIET(ifp->if_vnet); #ifdef VIMAGE /* * Skip processing if IPv6 reassembly is not initialised or * torn down by frag6_destroy(). */ - if (!V_frag6_on) + if (!V_frag6_on) { + CURVNET_RESTORE(); return; + } #endif - CURVNET_SET_QUIET(ifp->if_vnet); for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { IP6QB_LOCK(bucket); head = IP6QB_HEAD(bucket);