From 295078fa7ae7893f3deb0e6042e2aecfaba0dd1c Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Fri, 28 Jun 2019 15:27:25 -0700 Subject: Automated rollback of changelist 255263686 PiperOrigin-RevId: 255679453 --- pkg/sentry/fs/inode_overlay.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg') 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() -- cgit v1.2.3