diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-10-05 00:07:52 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-10-05 00:07:52 +0000 |
commit | 29595440908ff86dfa2ec0754fad51a317d975da (patch) | |
tree | 8eb8e26492b969dde5f1af60ce98de564a85a076 | |
parent | 524feb50f9983e4918e828842a663e3c966ca09c (diff) | |
parent | f24c3188b5d57b370ff048c87420a7f56a48b5b8 (diff) |
Merge release-20190806.1-239-gf24c318 (automated)
-rw-r--r-- | pkg/sentry/fs/inode_overlay.go | 6 |
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 |