diff options
author | Dean Deng <deandeng@google.com> | 2020-10-14 00:11:00 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-14 00:13:21 -0700 |
commit | a7b7b7b9804e9968c1fed5f7b3849233f585a88b (patch) | |
tree | d876f7ec3627e3f155b1a2d5bab8ee6c215889f7 /pkg/sentry/kernel/BUILD | |
parent | 631dd5330d438729a7a8f6e00b279386924de640 (diff) |
Fix shm reference leak.
All shm segments in an IPC namespace should be released once that namespace is
destroyed. Add reference counting to IPCNamespace so that once the last task
with a reference on it exits, we can trigger a destructor that will clean up
all shm segments that have not been explicitly freed by the application.
PiperOrigin-RevId: 337032977
Diffstat (limited to 'pkg/sentry/kernel/BUILD')
-rw-r--r-- | pkg/sentry/kernel/BUILD | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/BUILD b/pkg/sentry/kernel/BUILD index 5de70aecb..9a24c6bdb 100644 --- a/pkg/sentry/kernel/BUILD +++ b/pkg/sentry/kernel/BUILD @@ -97,6 +97,17 @@ go_template_instance( ) go_template_instance( + name = "ipc_namespace_refs", + out = "ipc_namespace_refs.go", + package = "kernel", + prefix = "IPCNamespace", + template = "//pkg/refs_vfs2:refs_template", + types = { + "T": "IPCNamespace", + }, +) + +go_template_instance( name = "process_group_refs", out = "process_group_refs.go", package = "kernel", @@ -137,6 +148,7 @@ go_library( "fs_context.go", "fs_context_refs.go", "ipc_namespace.go", + "ipc_namespace_refs.go", "kcov.go", "kcov_unsafe.go", "kernel.go", |