MCPcopy
hub / github.com/google/gvisor / CopyInString

Method CopyInString

pkg/sentry/kernel/task_usermem.go:50–52  ·  view source on GitHub ↗

CopyInString copies a NUL-terminated string of length at most maxlen in from the task's memory. The copy will fail with syscall.EFAULT if it traverses user memory that is unmapped or not readable by the user. Preconditions: The caller must be running on the task goroutine.

(addr hostarch.Addr, maxlen int)

Source from the content-addressed store, hash-verified

48//
49// Preconditions: The caller must be running on the task goroutine.
50func (t *Task) CopyInString(addr hostarch.Addr, maxlen int) (string, error) {
51 return usermem.CopyStringIn(t, t.MemoryManager(), addr, maxlen, usermem.IOOpts{})
52}
53
54// CopyInVector copies a NULL-terminated vector of strings from the task's
55// memory. The copy will fail with syscall.EFAULT if it traverses

Callers 15

CopyInVectorMethod · 0.95
getPciDeviceFdMethod · 0.80
keyctlJoinSessionKeyringFunction · 0.80
copyInPathFunction · 0.80
symlinkatFunction · 0.80
MemfdCreateFunction · 0.80
execveatFunction · 0.80
copyInXattrNameFunction · 0.80
MqOpenFunction · 0.80
MqUnlinkFunction · 0.80
MountFunction · 0.80
PrctlFunction · 0.80

Calls 2

MemoryManagerMethod · 0.95
CopyStringInFunction · 0.92

Tested by

no test coverage detected