summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/proc/task_files.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-21 23:36:34 +0000
committergVisor bot <gvisor-bot@google.com>2020-04-21 23:36:34 +0000
commit9e983d691225db47475f4447899e7421864b9b6c (patch)
tree7fe8779aa43d31d1c6199f5e44458eb1d8a425a7 /pkg/sentry/fsimpl/proc/task_files.go
parent306c14cdd4e68b95703e78c3877b627d4f7d7885 (diff)
parent37e01fd2ea6a0e67637975863317be9aae1b02f0 (diff)
Merge release-20200323.0-207-g37e01fd (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/proc/task_files.go')
-rwxr-xr-xpkg/sentry/fsimpl/proc/task_files.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkg/sentry/fsimpl/proc/task_files.go b/pkg/sentry/fsimpl/proc/task_files.go
index 2c6f8bdfc..f3173e197 100755
--- a/pkg/sentry/fsimpl/proc/task_files.go
+++ b/pkg/sentry/fsimpl/proc/task_files.go
@@ -111,17 +111,18 @@ func (d *auxvData) Generate(ctx context.Context, buf *bytes.Buffer) error {
}
defer m.DecUsers(ctx)
- // Space for buffer with AT_NULL (0) terminator at the end.
auxv := m.Auxv()
+ // Space for buffer with AT_NULL (0) terminator at the end.
buf.Grow((len(auxv) + 1) * 16)
for _, e := range auxv {
- var tmp [8]byte
- usermem.ByteOrder.PutUint64(tmp[:], e.Key)
- buf.Write(tmp[:])
-
- usermem.ByteOrder.PutUint64(tmp[:], uint64(e.Value))
+ var tmp [16]byte
+ usermem.ByteOrder.PutUint64(tmp[:8], e.Key)
+ usermem.ByteOrder.PutUint64(tmp[8:], uint64(e.Value))
buf.Write(tmp[:])
}
+ var atNull [16]byte
+ buf.Write(atNull[:])
+
return nil
}