Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2019 10:22:48 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r344356 - stable/12/sys/netinet
Message-ID:  <201902201022.x1KAMmhh022596@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed Feb 20 10:22:48 2019
New Revision: 344356
URL: https://svnweb.freebsd.org/changeset/base/344356

Log:
  MFC r344103:
    In r335015 PCB destroing was made deferred using epoch_call().
  
    But ipsec_delete_pcbpolicy() uses some VNET-virtualized variables,
    and thus it needs VNET context, that is missing during gtaskqueue
    executing. Use inp_vnet context to set curvnet in in_pcbfree_deferred().
  
    PR:		235684

Modified:
  stable/12/sys/netinet/in_pcb.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/in_pcb.c
==============================================================================
--- stable/12/sys/netinet/in_pcb.c	Wed Feb 20 10:03:03 2019	(r344355)
+++ stable/12/sys/netinet/in_pcb.c	Wed Feb 20 10:22:48 2019	(r344356)
@@ -1566,6 +1566,7 @@ in_pcbfree_deferred(epoch_context_t ctx)
 	inp = __containerof(ctx, struct inpcb, inp_epoch_ctx);
 
 	INP_WLOCK(inp);
+	CURVNET_SET(inp->inp_vnet);
 #ifdef INET
 	struct ip_moptions *imo = inp->inp_moptions;
 	inp->inp_moptions = NULL;
@@ -1598,6 +1599,7 @@ in_pcbfree_deferred(epoch_context_t ctx)
 #ifdef INET
 	inp_freemoptions(imo);
 #endif	
+	CURVNET_RESTORE();
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902201022.x1KAMmhh022596>