diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/sentry/fs/gofer/session.go | 5 | ||||
-rw-r--r-- | pkg/sentry/fs/gofer/session_state.go | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/pkg/sentry/fs/gofer/session.go b/pkg/sentry/fs/gofer/session.go index 1076e3e55..baf00d8e7 100644 --- a/pkg/sentry/fs/gofer/session.go +++ b/pkg/sentry/fs/gofer/session.go @@ -28,8 +28,9 @@ import ( ) type endpointMap struct { - mu sync.RWMutex - m map[device.MultiDeviceKey]unix.BoundEndpoint + mu sync.RWMutex `state:"nosave"` + // TODO: Make map with private unix sockets savable. + m map[device.MultiDeviceKey]unix.BoundEndpoint } // add adds the endpoint to the map. diff --git a/pkg/sentry/fs/gofer/session_state.go b/pkg/sentry/fs/gofer/session_state.go index 4d993a219..0154810c8 100644 --- a/pkg/sentry/fs/gofer/session_state.go +++ b/pkg/sentry/fs/gofer/session_state.go @@ -22,6 +22,15 @@ import ( "gvisor.googlesource.com/gvisor/pkg/unet" ) +// beforeSave is invoked by stateify. +// +// TODO: Make map with private unix sockets savable. +func (e *endpointMap) beforeSave() { + if len(e.m) != 0 { + panic("EndpointMap with existing private unix sockets cannot be saved") + } +} + // afterLoad is invoked by stateify. func (s *session) afterLoad() { // The restore environment contains the 9p connection of this mount. |