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

[LibOS,PAL] MAP_SHARED flag is not propagated to PAL #2146

@dimakuv

Description

@dimakuv

Description of the problem

During shim_do_mmap(), there could be a combination mmap(..., MAP_SHARED, ...) which is not possible on Linux-SGX PAL. However, the Linux-SGX PAL layer ignores this flag (which is transformed into !PAL_PROT_WRITECOPY via LINUX_PROT_TO_PAL()).

It seems that the simple fix is to check that prot doesn't contain PAL_PROT_WRITECOPY inside Linux-SGX's _DkVirtualMemoryAlloc() and fail with some PAL error.

It looks like the same situation happens in Linux PAL: the mapping is created as MAP_PRIVATE (never MAP_SHARED) always.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions