summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/mm/lifecycle.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2020-08-03 22:06:46 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-03 22:08:25 -0700
commit25798f214c6d1991916906ea8fca9e7029a8c423 (patch)
treee2240d0174da0d95a0a19660ea8c2bb0ebbf0082 /pkg/sentry/mm/lifecycle.go
parentb5c9ff81922ba785d83eaccc464b0b15a8120798 (diff)
Add callbacks to support lazy loading/restoring thread states
PiperOrigin-RevId: 324748508
Diffstat (limited to 'pkg/sentry/mm/lifecycle.go')
-rw-r--r--pkg/sentry/mm/lifecycle.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/sentry/mm/lifecycle.go b/pkg/sentry/mm/lifecycle.go
index 4d7773f8b..09dbc06a4 100644
--- a/pkg/sentry/mm/lifecycle.go
+++ b/pkg/sentry/mm/lifecycle.go
@@ -57,6 +57,8 @@ func (mm *MemoryManager) SetMmapLayout(ac arch.Context, r *limits.LimitSet) (arc
// Fork creates a copy of mm with 1 user, as for Linux syscalls fork() or
// clone() (without CLONE_VM).
func (mm *MemoryManager) Fork(ctx context.Context) (*MemoryManager, error) {
+ mm.AddressSpace().PreFork()
+ defer mm.AddressSpace().PostFork()
mm.metadataMu.Lock()
defer mm.metadataMu.Unlock()
mm.mappingMu.RLock()