summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/loader.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-10-12 10:39:03 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-12 10:41:04 -0700
commitd861cd5f14bc42b32eeac20c444a685f1d9748f7 (patch)
tree5552b9c9ef55049cd7db81caffc4b338ea256be5 /runsc/boot/loader.go
parentdb36d948fa63ce950d94a5e8e9ebc37956543661 (diff)
[vfs2] Don't leak disconnected mounts.
PiperOrigin-RevId: 336694658
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r--runsc/boot/loader.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index dee2c4fbb..9a08ebc60 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -472,9 +472,13 @@ func (l *Loader) Destroy() {
}
l.watchdog.Stop()
+ // Release all kernel resources. This is only safe after we can no longer
+ // save/restore.
+ l.k.Release()
+
// In the success case, stdioFDs and goferFDs will only contain
// released/closed FDs that ownership has been passed over to host FDs and
- // gofer sessions. Close them here in case on failure.
+ // gofer sessions. Close them here in case of failure.
for _, fd := range l.root.stdioFDs {
_ = fd.Close()
}