diff options
Diffstat (limited to 'pkg/sentry/fs/proc')
-rw-r--r-- | pkg/sentry/fs/proc/mounts.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/sentry/fs/proc/mounts.go b/pkg/sentry/fs/proc/mounts.go index 76092567d..3d276dfa5 100644 --- a/pkg/sentry/fs/proc/mounts.go +++ b/pkg/sentry/fs/proc/mounts.go @@ -44,7 +44,9 @@ func forEachMountSource(t *kernel.Task, fn func(string, *fs.MountSource)) { return ms[i].ID() < ms[j].ID() }) for _, m := range ms { - mountPath, desc := m.Root().FullName(rootDir) + mroot := m.Root() + mountPath, desc := mroot.FullName(rootDir) + mroot.DecRef() if !desc { // MountSources that are not descendants of the chroot jail are ignored. continue @@ -88,7 +90,9 @@ func (mif *mountInfoFile) ReadSeqFileData(handle seqfile.SeqHandle) ([]seqfile.S // (3) Major:Minor device ID. We don't have a superblock, so we // just use the root inode device number. - sa := m.Root().Inode.StableAttr + mroot := m.Root() + sa := mroot.Inode.StableAttr + mroot.DecRef() fmt.Fprintf(&buf, "%d:%d ", sa.DeviceFileMajor, sa.DeviceFileMinor) // (4) Root: the pathname of the directory in the filesystem |