From owner-svn-src-head@freebsd.org Tue Jun 12 23:54:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD2AF100C134; Tue, 12 Jun 2018 23:54:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60159809DD; Tue, 12 Jun 2018 23:54:09 +0000 (UTC) (envelope-from rrs@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 412B811B2E; Tue, 12 Jun 2018 23:54:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CNs99s018103; Tue, 12 Jun 2018 23:54:09 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CNs9gO018102; Tue, 12 Jun 2018 23:54:09 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806122354.w5CNs9gO018102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 12 Jun 2018 23:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335022 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 23:54:09 -0000 Author: rrs Date: Tue Jun 12 23:54:08 2018 New Revision: 335022 URL: https://svnweb.freebsd.org/changeset/base/335022 Log: This fixes missing VNET sets in the hpts system. Basically without this and running vnets with a TCP stack that uses some of the features is a recipe for panic (without this commit). Reported by: Larry Rosenman Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D15757 Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Tue Jun 12 23:26:25 2018 (r335021) +++ head/sys/netinet/tcp_hpts.c Tue Jun 12 23:54:08 2018 (r335022) @@ -1215,7 +1215,9 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim hpts->p_inp = inp; drop_reason = inp->inp_hpts_drop_reas; inp->inp_in_input = 0; + tp = intotcpcb(inp); mtx_unlock(&hpts->p_mtx); + CURVNET_SET(tp->t_vnet); if (drop_reason) { INP_INFO_RLOCK(&V_tcbinfo); ti_locked = TI_RLOCKED; @@ -1234,10 +1236,10 @@ out: INP_WUNLOCK(inp); } ti_locked = TI_UNLOCKED; + CURVNET_RESTORE(); mtx_lock(&hpts->p_mtx); continue; } - tp = intotcpcb(inp); if ((tp == NULL) || (tp->t_inpcb == NULL)) { goto out; } @@ -1262,6 +1264,7 @@ out: } if (in_pcbrele_wlocked(inp) == 0) INP_WUNLOCK(inp); + CURVNET_RESTORE(); mtx_lock(&hpts->p_mtx); continue; } @@ -1282,7 +1285,6 @@ out: */ tcp_set_hpts(inp); } - CURVNET_SET(tp->t_vnet); m = tp->t_in_pkt; n = NULL; if (m != NULL && @@ -1366,7 +1368,6 @@ out: if (m) n = m->m_nextpkt; } - CURVNET_RESTORE(); goto out; } /*