From owner-svn-src-head@freebsd.org Sat Jul 14 09:11:33 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 9C7D21047C6B; Sat, 14 Jul 2018 09:11:33 +0000 (UTC) (envelope-from kp@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 5204471BE2; Sat, 14 Jul 2018 09:11:33 +0000 (UTC) (envelope-from kp@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 331191CFA1; Sat, 14 Jul 2018 09:11:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6E9BXRm097690; Sat, 14 Jul 2018 09:11:33 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6E9BXnJ097689; Sat, 14 Jul 2018 09:11:33 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201807140911.w6E9BXnJ097689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 14 Jul 2018 09:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336273 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 336273 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.27 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: Sat, 14 Jul 2018 09:11:33 -0000 Author: kp Date: Sat Jul 14 09:11:32 2018 New Revision: 336273 URL: https://svnweb.freebsd.org/changeset/base/336273 Log: pf: Fix panic on vnet jail shutdown with synproxy When shutting down a vnet jail pf_shutdown() clears the remaining states, which through pf_clear_states() calls pf_unlink_state(). For synproxy states pf_unlink_state() will send a TCP RST, which eventually tries to schedule the pf swi in pf_send(). This means we can't remove the software interrupt until after pf_shutdown(). MFC after: 1 week Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat Jul 14 06:43:37 2018 (r336272) +++ head/sys/netpfil/pf/pf_ioctl.c Sat Jul 14 09:11:32 2018 (r336273) @@ -3951,7 +3951,6 @@ pf_unload_vnet(void) V_pf_vnet_active = 0; V_pf_status.running = 0; - swi_remove(V_pf_swi_cookie); error = dehook_pf(); if (error) { /* @@ -3966,6 +3965,8 @@ pf_unload_vnet(void) PF_RULES_WLOCK(); shutdown_pf(); PF_RULES_WUNLOCK(); + + swi_remove(V_pf_swi_cookie); pf_unload_vnet_purge();