summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-11-12 22:49:22 -0800
committergVisor bot <gvisor-bot@google.com>2019-11-12 23:01:47 -0800
commitc2d3dc0c13e1adfc182c33d57e410c46fe12415f (patch)
tree172637d44e69e7643bb0f0e457478c78fbbac660 /pkg/sentry/fs
parent2c6c9af904c99371fe4381517375cd114917db59 (diff)
Use overlay MountSource when binding socket in overlay.
PiperOrigin-RevId: 280131840
Diffstat (limited to 'pkg/sentry/fs')
-rw-r--r--pkg/sentry/fs/inode_overlay.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/fs/inode_overlay.go b/pkg/sentry/fs/inode_overlay.go
index 5a388dad1..a09147080 100644
--- a/pkg/sentry/fs/inode_overlay.go
+++ b/pkg/sentry/fs/inode_overlay.go
@@ -462,7 +462,9 @@ func overlayBind(ctx context.Context, o *overlayEntry, parent *Dirent, name stri
inode.DecRef()
return nil, err
}
- return NewDirent(ctx, newOverlayInode(ctx, entry, inode.MountSource), name), nil
+ // Use the parent's MountSource, since that corresponds to the overlay,
+ // and not the upper filesystem.
+ return NewDirent(ctx, newOverlayInode(ctx, entry, parent.Inode.MountSource), name), nil
}
func overlayBoundEndpoint(o *overlayEntry, path string) transport.BoundEndpoint {