summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-17 01:00:38 +0000
committergVisor bot <gvisor-bot@google.com>2021-04-17 01:00:38 +0000
commitce460ce2f19e4b8c63f846d6258a0948a0766578 (patch)
treee029fa98ad0b419efa5ac5827746e6dc522f463f /pkg/sentry/syscalls/linux
parented4ffd6b8cc12ae502d8077843d53a630f5cf519 (diff)
parent0c3e8daf503e011f0ef3e2a1c6d8b6ffd946acab (diff)
Merge release-20210408.0-46-g0c3e8daf5 (automated)
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r--pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go20
-rw-r--r--pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go12
2 files changed, 16 insertions, 16 deletions
diff --git a/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go b/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go
index 6201b2feb..8539f13c3 100644
--- a/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go
+++ b/pkg/sentry/syscalls/linux/linux_abi_autogen_unsafe.go
@@ -211,12 +211,12 @@ func (r *rlimit64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (r *rlimit64) MarshalUnsafe(dst []byte) {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(r.SizeBytes()))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (r *rlimit64) UnmarshalUnsafe(src []byte) {
- gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(r.SizeBytes()))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -300,12 +300,12 @@ func (s *SchedParam) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *SchedParam) MarshalUnsafe(dst []byte) {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(s.SizeBytes()))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *SchedParam) UnmarshalUnsafe(src []byte) {
- gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(s.SizeBytes()))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -398,12 +398,12 @@ func (u *userSockFprog) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (u *userSockFprog) MarshalUnsafe(dst []byte) {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(u.SizeBytes()))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (u *userSockFprog) UnmarshalUnsafe(src []byte) {
- gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(u.SizeBytes()))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -519,12 +519,12 @@ func (m *MessageHeader64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (m *MessageHeader64) MarshalUnsafe(dst []byte) {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(m.SizeBytes()))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (m *MessageHeader64) UnmarshalUnsafe(src []byte) {
- gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(m.SizeBytes()))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -618,7 +618,7 @@ func (m *multipleMessageHeader64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (m *multipleMessageHeader64) MarshalUnsafe(dst []byte) {
if m.msgHdr.Packed() {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(m.SizeBytes()))
} else {
// Type multipleMessageHeader64 doesn't have a packed layout in memory, fallback to MarshalBytes.
m.MarshalBytes(dst)
@@ -628,7 +628,7 @@ func (m *multipleMessageHeader64) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (m *multipleMessageHeader64) UnmarshalUnsafe(src []byte) {
if m.msgHdr.Packed() {
- gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(m.SizeBytes()))
} else {
// Type multipleMessageHeader64 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
m.UnmarshalBytes(src)
diff --git a/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go b/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go
index 97fc5d2a8..0525fce4c 100644
--- a/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go
+++ b/pkg/sentry/syscalls/linux/vfs2/vfs2_abi_autogen_unsafe.go
@@ -52,12 +52,12 @@ func (s *sigSetWithSize) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (s *sigSetWithSize) MarshalUnsafe(dst []byte) {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(s.SizeBytes()))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (s *sigSetWithSize) UnmarshalUnsafe(src []byte) {
- gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(s.SizeBytes()))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -173,12 +173,12 @@ func (m *MessageHeader64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (m *MessageHeader64) MarshalUnsafe(dst []byte) {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(m.SizeBytes()))
}
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (m *MessageHeader64) UnmarshalUnsafe(src []byte) {
- gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(m.SizeBytes()))
}
// CopyOutN implements marshal.Marshallable.CopyOutN.
@@ -272,7 +272,7 @@ func (m *multipleMessageHeader64) Packed() bool {
// MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
func (m *multipleMessageHeader64) MarshalUnsafe(dst []byte) {
if m.msgHdr.Packed() {
- gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(len(dst)))
+ gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(m.SizeBytes()))
} else {
// Type multipleMessageHeader64 doesn't have a packed layout in memory, fallback to MarshalBytes.
m.MarshalBytes(dst)
@@ -282,7 +282,7 @@ func (m *multipleMessageHeader64) MarshalUnsafe(dst []byte) {
// UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
func (m *multipleMessageHeader64) UnmarshalUnsafe(src []byte) {
if m.msgHdr.Packed() {
- gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(len(src)))
+ gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(m.SizeBytes()))
} else {
// Type multipleMessageHeader64 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
m.UnmarshalBytes(src)