You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Seems that PAL API doesn't even have a notion of shared memory? And I don't think it should, this concept is (I think) not compatible with the rest of this API.
So, should we just error out on MAP_SHARED in LibOS?
It does: PAL_PROT_WRITECOPY means CoW (translates to MAP_PRIVATE on Linux), lack of it means shared memory (MAP_SHARED). The convention might be questionable, but the feature is supported atm.
Description of the problem
During
shim_do_mmap()
, there could be a combinationmmap(..., 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
viaLINUX_PROT_TO_PAL()
).It seems that the simple fix is to check that
prot
doesn't containPAL_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
(neverMAP_SHARED
) always.The text was updated successfully, but these errors were encountered: