summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/mm/vma.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/vma.go
parentb5c9ff81922ba785d83eaccc464b0b15a8120798 (diff)
Add callbacks to support lazy loading/restoring thread states
PiperOrigin-RevId: 324748508
Diffstat (limited to 'pkg/sentry/mm/vma.go')
-rw-r--r--pkg/sentry/mm/vma.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/sentry/mm/vma.go b/pkg/sentry/mm/vma.go
index bd751d696..c4e1989ed 100644
--- a/pkg/sentry/mm/vma.go
+++ b/pkg/sentry/mm/vma.go
@@ -42,7 +42,12 @@ func (mm *MemoryManager) createVMALocked(ctx context.Context, opts memmap.MMapOp
Map32Bit: opts.Map32Bit,
})
if err != nil {
- return vmaIterator{}, usermem.AddrRange{}, err
+ // Can't force without opts.Unmap and opts.Fixed.
+ if opts.Force && opts.Unmap && opts.Fixed {
+ addr = opts.Addr
+ } else {
+ return vmaIterator{}, usermem.AddrRange{}, err
+ }
}
ar, _ := addr.ToRange(opts.Length)