summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2018-05-11 11:16:57 -0700
committerShentubot <shentubot@google.com>2018-05-11 11:18:31 -0700
commit12c161f27865d0e389cd593c669bd740d7f24692 (patch)
tree16cc86b1268592766af6c0fcd018608eacc808bc /pkg/sentry/syscalls/linux
parentf24db99498a8a061f3b80e633eaa648984338e58 (diff)
Implement MAP_32BIT.
PiperOrigin-RevId: 196281052 Change-Id: Ie620a0f983a1bf2570d0003d4754611879335c1c
Diffstat (limited to 'pkg/sentry/syscalls/linux')
-rw-r--r--pkg/sentry/syscalls/linux/sys_mmap.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_mmap.go b/pkg/sentry/syscalls/linux/sys_mmap.go
index 2c7d41de0..bfa23f6a8 100644
--- a/pkg/sentry/syscalls/linux/sys_mmap.go
+++ b/pkg/sentry/syscalls/linux/sys_mmap.go
@@ -45,6 +45,7 @@ func Mmap(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallC
private := flags&linux.MAP_PRIVATE != 0
shared := flags&linux.MAP_SHARED != 0
anon := flags&linux.MAP_ANONYMOUS != 0
+ map32bit := flags&linux.MAP_32BIT != 0
// Require exactly one of MAP_PRIVATE and MAP_SHARED.
if private == shared {
@@ -52,12 +53,13 @@ func Mmap(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallC
}
opts := memmap.MMapOpts{
- Length: args[1].Uint64(),
- Offset: args[5].Uint64(),
- Addr: args[0].Pointer(),
- Fixed: fixed,
- Unmap: fixed,
- Private: private,
+ Length: args[1].Uint64(),
+ Offset: args[5].Uint64(),
+ Addr: args[0].Pointer(),
+ Fixed: fixed,
+ Unmap: fixed,
+ Map32Bit: map32bit,
+ Private: private,
Perms: usermem.AccessType{
Read: linux.PROT_READ&prot != 0,
Write: linux.PROT_WRITE&prot != 0,