Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

[LibOS] Error out on anonymous shared mappings in mmap syscall #2147

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions LibOS/shim/src/sys/shim_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ void* shim_do_mmap(void* addr, size_t length, int prot, int flags, int fd, off_t
if (flags & MAP_ANONYMOUS) {
switch (flags & MAP_TYPE) {
case MAP_SHARED:
/* PAL API doesn't support anonymous shared memory. */
return (void*)-ENOSYS;
case MAP_PRIVATE:
break;
default:
Expand Down
4 changes: 4 additions & 0 deletions LibOS/shim/test/ltp/ltp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ skip = yes
[futex_cmp_requeue01]
skip = yes

# uses anonymous shared mappings (which are not supported)
[futex_cmp_requeue02]
skip = yes

# always fails to open /proc/PID/stat, but the whole test fails only sometimes
[futex_wait02]
skip = yes
Expand Down