summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/shm
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2019-06-28 20:06:33 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-28 20:07:52 -0700
commit45566fa4e4bc55e870ae1d7f80778be8432bdef5 (patch)
tree9b9064ef22a6f34ade4714cc90ad0573440c3e1c /pkg/sentry/kernel/shm
parent7dae043fecc109d7a0ae1d5d6274e48b1bf04d13 (diff)
Add finalizer on AtomicRefCount to check for leaks.
PiperOrigin-RevId: 255711454
Diffstat (limited to 'pkg/sentry/kernel/shm')
-rw-r--r--pkg/sentry/kernel/shm/shm.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/shm/shm.go b/pkg/sentry/kernel/shm/shm.go
index 3e9fe70e2..5bd610f68 100644
--- a/pkg/sentry/kernel/shm/shm.go
+++ b/pkg/sentry/kernel/shm/shm.go
@@ -224,6 +224,7 @@ func (r *Registry) newShm(ctx context.Context, pid int32, key Key, creator fs.Fi
creatorPID: pid,
changeTime: ktime.NowFromContext(ctx),
}
+ shm.EnableLeakCheck("kernel.Shm")
// Find the next available ID.
for id := r.lastIDUsed + 1; id != r.lastIDUsed; id++ {