From 26e8d9981fcf6d08199a9fd9c609d9715c3cf37e Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Fri, 29 Mar 2019 16:24:29 -0700 Subject: Use kernel.Task.CopyScratchBuffer in syscalls/linux where possible. PiperOrigin-RevId: 241072126 Change-Id: Ib4d9f58f550732ac4c5153d3cf159a5b1a9749da --- pkg/sentry/syscalls/linux/sys_socket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/sentry/syscalls/linux/sys_socket.go') diff --git a/pkg/sentry/syscalls/linux/sys_socket.go b/pkg/sentry/syscalls/linux/sys_socket.go index 564357bac..49e6f4aeb 100644 --- a/pkg/sentry/syscalls/linux/sys_socket.go +++ b/pkg/sentry/syscalls/linux/sys_socket.go @@ -516,7 +516,7 @@ func SetSockOpt(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sy if optLen > maxOptLen { return 0, nil, syscall.EINVAL } - buf := make([]byte, optLen) + buf := t.CopyScratchBuffer(int(optLen)) if _, err := t.CopyIn(optValAddr, &buf); err != nil { return 0, nil, err } -- cgit v1.2.3