diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-03-29 20:35:44 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-29 20:35:44 +0000 |
commit | 08cc017c088017546ed712cce700bf4374c864c0 (patch) | |
tree | af024e69d8855f4f867ef435ced35532b368a981 /pkg/sentry/vfs/inotify.go | |
parent | 6a422755602daeaef4be60969c1acddc8b7b3041 (diff) | |
parent | 8a2f7e716dcc62f04d2808e8ade34941c94fc956 (diff) |
Merge release-20210322.0-29-g8a2f7e716 (automated)
Diffstat (limited to 'pkg/sentry/vfs/inotify.go')
-rw-r--r-- | pkg/sentry/vfs/inotify.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/sentry/vfs/inotify.go b/pkg/sentry/vfs/inotify.go index 32fa01578..49d29e20b 100644 --- a/pkg/sentry/vfs/inotify.go +++ b/pkg/sentry/vfs/inotify.go @@ -21,6 +21,7 @@ import ( "gvisor.dev/gvisor/pkg/abi/linux" "gvisor.dev/gvisor/pkg/context" + "gvisor.dev/gvisor/pkg/hostarch" "gvisor.dev/gvisor/pkg/sentry/arch" "gvisor.dev/gvisor/pkg/sentry/uniqueid" "gvisor.dev/gvisor/pkg/sync" @@ -256,7 +257,7 @@ func (i *Inotify) Ioctl(ctx context.Context, uio usermem.IO, args arch.SyscallAr n += uint32(e.sizeOf()) } var buf [4]byte - usermem.ByteOrder.PutUint32(buf[:], n) + hostarch.ByteOrder.PutUint32(buf[:], n) _, err := uio.CopyOut(ctx, args[2].Pointer(), buf[:], usermem.IOOpts{}) return 0, err @@ -683,10 +684,10 @@ func (e *Event) sizeOf() int { // construct the output. We use a buffer allocated ahead of time for // performance. buf must be at least inotifyEventBaseSize bytes. func (e *Event) CopyTo(ctx context.Context, buf []byte, dst usermem.IOSequence) (int64, error) { - usermem.ByteOrder.PutUint32(buf[0:], uint32(e.wd)) - usermem.ByteOrder.PutUint32(buf[4:], e.mask) - usermem.ByteOrder.PutUint32(buf[8:], e.cookie) - usermem.ByteOrder.PutUint32(buf[12:], e.len) + hostarch.ByteOrder.PutUint32(buf[0:], uint32(e.wd)) + hostarch.ByteOrder.PutUint32(buf[4:], e.mask) + hostarch.ByteOrder.PutUint32(buf[8:], e.cookie) + hostarch.ByteOrder.PutUint32(buf[12:], e.len) writeLen := 0 |