summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/proc/task_fds.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-04-06 16:31:27 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-06 16:32:37 -0700
commitdd98fdd5beb7f02e7c7b3aeb4f07f5d00ffc41e7 (patch)
treee6283145cf7bfba07af15b98681eec219948f6bf /pkg/sentry/fsimpl/proc/task_fds.go
parentf332a864e8cc7799332838deffab37244ff8ffc7 (diff)
Correctly implement magic symlinks in VFS2 procfs.
Updates #1195 PiperOrigin-RevId: 305143567
Diffstat (limited to 'pkg/sentry/fsimpl/proc/task_fds.go')
-rw-r--r--pkg/sentry/fsimpl/proc/task_fds.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/proc/task_fds.go b/pkg/sentry/fsimpl/proc/task_fds.go
index 76bfc5307..9c8656b28 100644
--- a/pkg/sentry/fsimpl/proc/task_fds.go
+++ b/pkg/sentry/fsimpl/proc/task_fds.go
@@ -196,6 +196,12 @@ func (s *fdSymlink) Readlink(ctx context.Context) (string, error) {
return vfsObj.PathnameWithDeleted(ctx, root, s.file.VirtualDentry())
}
+func (s *fdSymlink) Getlink(ctx context.Context) (vfs.VirtualDentry, string, error) {
+ vd := s.file.VirtualDentry()
+ vd.IncRef()
+ return vd, "", nil
+}
+
func (s *fdSymlink) DecRef() {
s.AtomicRefCount.DecRefWithDestructor(func() {
s.Destroy()