summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/dirent.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-06-13 20:00:00 -0700
committerShentubot <shentubot@google.com>2018-06-13 20:00:55 -0700
commitf5d0c59f5c736f5f7fceb566e134f41b03229c22 (patch)
treef2a68a0f3f31a6b299097cfe8548a4c2b072fe59 /pkg/sentry/fs/dirent.go
parent1170039e788db368615451a0a1f5cfccb1d28d41 (diff)
Fix reference leak in VDSO validation
PiperOrigin-RevId: 200496070 Change-Id: I33adb717c44e5b4bcadece882be3ab1ee3920556
Diffstat (limited to 'pkg/sentry/fs/dirent.go')
-rw-r--r--pkg/sentry/fs/dirent.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/fs/dirent.go b/pkg/sentry/fs/dirent.go
index 554aa30d8..b56437b3c 100644
--- a/pkg/sentry/fs/dirent.go
+++ b/pkg/sentry/fs/dirent.go
@@ -213,7 +213,12 @@ func NewDirent(inode *Inode, name string) *Dirent {
// NewTransientDirent creates a transient Dirent that shouldn't actually be
// visible to users.
+//
+// An Inode is required.
func NewTransientDirent(inode *Inode) *Dirent {
+ if inode == nil {
+ panic("an inode is required")
+ }
return newDirent(inode, "transient")
}