Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion runsc/cmd/gofer.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...any) subcomm
defer cleanupUnmounter()
}
}
goferToHostRPC.Close()
if g.applyCaps {
overrides := g.syncFDs.flags()
overrides["apply-caps"] = "false"
Expand All @@ -207,6 +206,11 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...any) subcomm
panic("unreachable")
}

// This can't happen until after setCapsAndCallSelf(), since otherwise the
// re-executed gofer may reuse goferToHostRPCFD's file descriptor for an
// unrelated file.
goferToHostRPC.Close()

// Start profiling. This will be a noop if no profiling arguments were passed.
profileOpts := profile.MakeOpts(&g.profileFDs, conf.ProfileGCInterval)
g.stopProfiling = profile.Start(profileOpts)
Expand Down
Loading