summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/mm/lifecycle.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2019-06-05 13:59:01 -0700
committerShentubot <shentubot@google.com>2019-06-05 14:00:13 -0700
commitd3ed9baac0dc967eaf6d3e3f986cafe60604121a (patch)
tree47121539775297207ba205b60b136c9093d5d393 /pkg/sentry/mm/lifecycle.go
parentcecb71dc37a77d8e4e88cdfada92a37a72c67602 (diff)
Implement dumpability tracking and checks
We don't actually support core dumps, but some applications want to get/set dumpability, which still has an effect in procfs. Lack of support for set-uid binaries or fs creds simplifies things a bit. As-is, processes started via CreateProcess (i.e., init and sentryctl exec) have normal dumpability. I'm a bit torn on whether sentryctl exec tasks should be dumpable, but at least since they have no parent normal UID/GID checks should protect them. PiperOrigin-RevId: 251712714
Diffstat (limited to 'pkg/sentry/mm/lifecycle.go')
-rw-r--r--pkg/sentry/mm/lifecycle.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/sentry/mm/lifecycle.go b/pkg/sentry/mm/lifecycle.go
index 7a65a62a2..7646d5ab2 100644
--- a/pkg/sentry/mm/lifecycle.go
+++ b/pkg/sentry/mm/lifecycle.go
@@ -37,6 +37,7 @@ func NewMemoryManager(p platform.Platform, mfp pgalloc.MemoryFileProvider) *Memo
privateRefs: &privateRefs{},
users: 1,
auxv: arch.Auxv{},
+ dumpability: UserDumpable,
aioManager: aioManager{contexts: make(map[uint64]*AIOContext)},
}
}
@@ -79,8 +80,9 @@ func (mm *MemoryManager) Fork(ctx context.Context) (*MemoryManager, error) {
envv: mm.envv,
auxv: append(arch.Auxv(nil), mm.auxv...),
// IncRef'd below, once we know that there isn't an error.
- executable: mm.executable,
- aioManager: aioManager{contexts: make(map[uint64]*AIOContext)},
+ executable: mm.executable,
+ dumpability: mm.dumpability,
+ aioManager: aioManager{contexts: make(map[uint64]*AIOContext)},
}
// Copy vmas.