Skip to content

Commit 64e48cc

Browse files
nixprimegvisor-bot
authored andcommitted
fsimpl/gofer: implement specialFileFD.InvalidateUnsavable()
This fixes save/restore of mmapped gofer.specialFileFDs (usually obtained via mount option "disable_file_handle_sharing") for which mappings have actually been used (mm.pmas have been obtained). PiperOrigin-RevId: 700465816
1 parent e1cb1a7 commit 64e48cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/sentry/fsimpl/gofer/special_file.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ func (fd *specialFileFD) Translate(ctx context.Context, required, optional memma
482482

483483
// InvalidateUnsavable implements memmap.Mappable.InvalidateUnsavable.
484484
func (fd *specialFileFD) InvalidateUnsavable(ctx context.Context) error {
485+
d := fd.dentry()
486+
d.mapsMu.Lock()
487+
defer d.mapsMu.Unlock()
488+
d.mappings.InvalidateAll(memmap.InvalidateOpts{})
485489
return nil
486490
}
487491

0 commit comments

Comments
 (0)