diff options
author | Jamie Liu <jamieliu@google.com> | 2018-06-12 12:37:06 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-12 12:38:02 -0700 |
commit | 7a10df454b1c12b207f479cdda7338fff2875d5f (patch) | |
tree | f6bfed8da42e8496583793ce86ef8fa5050ad8d1 /pkg/sentry | |
parent | 2dc9cd7bf73d971a37fa22b52a70961f27f6c970 (diff) |
Drop MMapOpts.MappingIdentity reference in loader.mapSegment.
PiperOrigin-RevId: 200261995
Change-Id: I7e460b18ceab2c23096bdeb7416159d6e774aaf7
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/loader/elf.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/loader/elf.go b/pkg/sentry/loader/elf.go index 8579eeee4..d2f18cd4f 100644 --- a/pkg/sentry/loader/elf.go +++ b/pkg/sentry/loader/elf.go @@ -271,6 +271,11 @@ func mapSegment(ctx context.Context, m *mm.MemoryManager, f *fs.File, phdr *elf. Perms: prot, MaxPerms: usermem.AnyAccess, } + defer func() { + if mopts.MappingIdentity != nil { + mopts.MappingIdentity.DecRef() + } + }() if err := f.ConfigureMMap(ctx, &mopts); err != nil { ctx.Infof("File is not memory-mappable: %v", err) return err |