From d201feb8c5e425bfa8abc905f24d49b268520aec Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Tue, 15 Sep 2020 23:37:04 -0700 Subject: Enable automated marshalling for the syscall package. PiperOrigin-RevId: 331940975 --- pkg/sentry/fsimpl/verity/BUILD | 1 + pkg/sentry/fsimpl/verity/verity.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'pkg/sentry/fsimpl') diff --git a/pkg/sentry/fsimpl/verity/BUILD b/pkg/sentry/fsimpl/verity/BUILD index 814eb2085..bc8e38431 100644 --- a/pkg/sentry/fsimpl/verity/BUILD +++ b/pkg/sentry/fsimpl/verity/BUILD @@ -13,6 +13,7 @@ go_library( "//pkg/abi/linux", "//pkg/context", "//pkg/fspath", + "//pkg/marshal/primitive", "//pkg/merkletree", "//pkg/sentry/arch", "//pkg/sentry/fs/lock", diff --git a/pkg/sentry/fsimpl/verity/verity.go b/pkg/sentry/fsimpl/verity/verity.go index e352ce197..249cc1341 100644 --- a/pkg/sentry/fsimpl/verity/verity.go +++ b/pkg/sentry/fsimpl/verity/verity.go @@ -28,6 +28,7 @@ import ( "gvisor.dev/gvisor/pkg/abi/linux" "gvisor.dev/gvisor/pkg/context" "gvisor.dev/gvisor/pkg/fspath" + "gvisor.dev/gvisor/pkg/marshal/primitive" "gvisor.dev/gvisor/pkg/merkletree" "gvisor.dev/gvisor/pkg/sentry/arch" @@ -598,7 +599,10 @@ func (fd *fileDescription) getFlags(ctx context.Context, uio usermem.IO, args ar if len(fd.d.rootHash) != 0 { f |= linux.FS_VERITY_FL } - _, err := kernel.TaskFromContext(ctx).CopyOut(args[2].Pointer(), f) + + t := kernel.TaskFromContext(ctx) + addr := args[2].Pointer() + _, err := primitive.CopyInt32Out(t, addr, f) return 0, err } -- cgit v1.2.3