summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/mm/procfs.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2020-04-21 16:30:26 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-21 16:31:53 -0700
commit37e01fd2ea6a0e67637975863317be9aae1b02f0 (patch)
tree4fb37a116e3cedfb99597dc7d01a7808195744b4 /pkg/sentry/mm/procfs.go
parenteba086642e466f275b1f2df1284997b2ba0c28dc (diff)
Misc VFS2 fixes
- Fix defer operation ordering in kernfs.Filesystem.AccessAt() - Add AT_NULL entry in proc/pid/auvx - Fix line padding in /proc/pid/maps - Fix linux_dirent serialization for getdents(2) - Remove file creation flags from vfs.FileDescription.statusFlags() Updates #1193, #1035 PiperOrigin-RevId: 307704159
Diffstat (limited to 'pkg/sentry/mm/procfs.go')
-rw-r--r--pkg/sentry/mm/procfs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/mm/procfs.go b/pkg/sentry/mm/procfs.go
index 1ab92f046..6efe5102b 100644
--- a/pkg/sentry/mm/procfs.go
+++ b/pkg/sentry/mm/procfs.go
@@ -148,7 +148,7 @@ func (mm *MemoryManager) appendVMAMapsEntryLocked(ctx context.Context, vseg vmaI
// Do not include the guard page: fs/proc/task_mmu.c:show_map_vma() =>
// stack_guard_page_start().
- fmt.Fprintf(b, "%08x-%08x %s%s %08x %02x:%02x %d ",
+ lineLen, _ := fmt.Fprintf(b, "%08x-%08x %s%s %08x %02x:%02x %d ",
vseg.Start(), vseg.End(), vma.realPerms, private, vma.off, devMajor, devMinor, ino)
// Figure out our filename or hint.
@@ -165,7 +165,7 @@ func (mm *MemoryManager) appendVMAMapsEntryLocked(ctx context.Context, vseg vmaI
}
if s != "" {
// Per linux, we pad until the 74th character.
- if pad := 73 - b.Len(); pad > 0 {
+ if pad := 73 - lineLen; pad > 0 {
b.WriteString(strings.Repeat(" ", pad))
}
b.WriteString(s)