From eafa3f19e4d2c0a490af78dbe77289c7b5edbb76 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Mon, 18 Oct 2021 11:44:11 -0700 Subject: Mount namespace can be nil after task exits Updates #1035 PiperOrigin-RevId: 404017795 --- runsc/boot/loader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runsc/boot') diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index 28dbbcf1f..dbb02fdf4 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -950,7 +950,7 @@ func (l *Loader) executeAsync(args *control.ExecArgs) (kernel.ThreadID, error) { if kernel.VFS2Enabled { // task.MountNamespaceVFS2() does not take a ref, so we must do so ourselves. args.MountNamespaceVFS2 = tg.Leader().MountNamespaceVFS2() - if !args.MountNamespaceVFS2.TryIncRef() { + if args.MountNamespaceVFS2 == nil || !args.MountNamespaceVFS2.TryIncRef() { return 0, fmt.Errorf("container %q has stopped", args.ContainerID) } } else { -- cgit v1.2.3