summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-10-05 00:07:52 +0000
committergVisor bot <gvisor-bot@google.com>2019-10-05 00:07:52 +0000
commit29595440908ff86dfa2ec0754fad51a317d975da (patch)
tree8eb8e26492b969dde5f1af60ce98de564a85a076
parent524feb50f9983e4918e828842a663e3c966ca09c (diff)
parentf24c3188b5d57b370ff048c87420a7f56a48b5b8 (diff)
Merge release-20190806.1-239-gf24c318 (automated)
-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 246b97161..5a388dad1 100644
--- a/pkg/sentry/fs/inode_overlay.go
+++ b/pkg/sentry/fs/inode_overlay.go
@@ -15,6 +15,7 @@
package fs
import (
+ "fmt"
"strings"
"gvisor.dev/gvisor/pkg/abi/linux"
@@ -207,6 +208,11 @@ func overlayLookup(ctx context.Context, parent *overlayEntry, inode *Inode, name
}
func overlayCreate(ctx context.Context, o *overlayEntry, parent *Dirent, name string, flags FileFlags, perm FilePermissions) (*File, error) {
+ // Sanity check.
+ if parent.Inode.overlay == nil {
+ panic(fmt.Sprintf("overlayCreate called with non-overlay parent inode (parent InodeOperations type is %T)", parent.Inode.InodeOperations))
+ }
+
// Dirent.Create takes renameMu if the Inode is an overlay Inode.
if err := copyUpLockedForRename(ctx, parent); err != nil {
return nil, err