summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2019-06-28 15:27:25 -0700
committergVisor bot <gvisor-bot@google.com>2019-06-28 15:28:41 -0700
commit295078fa7ae7893f3deb0e6042e2aecfaba0dd1c (patch)
treea03544fe8182db496dc7b96c5d68d64b5bb66b41 /pkg/sentry/fs
parente21d49c2d82b7d109bc7c8955edea1787de59ac0 (diff)
Automated rollback of changelist 255263686
PiperOrigin-RevId: 255679453
Diffstat (limited to 'pkg/sentry/fs')
-rw-r--r--pkg/sentry/fs/inode_overlay.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fs/inode_overlay.go b/pkg/sentry/fs/inode_overlay.go
index b247fa514..24b769cfc 100644
--- a/pkg/sentry/fs/inode_overlay.go
+++ b/pkg/sentry/fs/inode_overlay.go
@@ -567,6 +567,12 @@ func overlayCheck(ctx context.Context, o *overlayEntry, p PermMask) error {
if o.upper != nil {
err = o.upper.check(ctx, p)
} else {
+ if p.Write {
+ // Since writes will be redirected to the upper filesystem, the lower
+ // filesystem need not be writable, but must be readable for copy-up.
+ p.Write = false
+ p.Read = true
+ }
err = o.lower.check(ctx, p)
}
o.copyMu.RUnlock()