From 2cc0fd42f462f3942230c4b33ca2825e2a28765d Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Fri, 24 Apr 2020 11:43:49 -0700 Subject: Fixes for procfs - Return ENOENT for /proc/[pid]/task if task is zoombied or terminated - Allow directory to be Seek() to the end - Construct synthetic files for /proc/[pid]/ns/* - Changed GenericDirectoryFD.Init to not register with FileDescription, otherwise other implementation cannot change behavior. Updates #1195,1193 PiperOrigin-RevId: 308294649 --- pkg/sentry/vfs/vfs.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/sentry/vfs') diff --git a/pkg/sentry/vfs/vfs.go b/pkg/sentry/vfs/vfs.go index cb5bbd781..9015f2cc1 100644 --- a/pkg/sentry/vfs/vfs.go +++ b/pkg/sentry/vfs/vfs.go @@ -797,6 +797,14 @@ type VirtualDentry struct { dentry *Dentry } +// MakeVirtualDentry creates a VirtualDentry. +func MakeVirtualDentry(mount *Mount, dentry *Dentry) VirtualDentry { + return VirtualDentry{ + mount: mount, + dentry: dentry, + } +} + // Ok returns true if vd is not empty. It does not require that a reference is // held. func (vd VirtualDentry) Ok() bool { -- cgit v1.2.3