From d861cd5f14bc42b32eeac20c444a685f1d9748f7 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Mon, 12 Oct 2020 10:39:03 -0700 Subject: [vfs2] Don't leak disconnected mounts. PiperOrigin-RevId: 336694658 --- runsc/boot/loader.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'runsc/boot/loader.go') 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() } -- cgit v1.2.3