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
Implement a RAII memory mapping primitive that allows us to manage virtual memory associated with WASM instances. In essence this should behave like a wrapper around mmap_anonymous, so things the type must support:
construction from a specific virtual address range
Should zero memory range
Like mmap(2) with MAP_FIXED_NOREPLACE | MAP_ANONYMOUS where the ptr and len arg correspond to the range.
Fail if address range is misaligned
Fail if range size is not multiple of page size
Fail if address range is already reserved
Fail if out-of-memory
construction from an allocator chosen address range
Should zero memory range
Like mmap(2) with MAP_FIXED_NOREPLACE | MAP_ANONYMOUS where the ptr is NULL and len is the range length.
should choose an arbitrary free range
should use randomization if ASLR is enabled
Fail if range size is not multiple of page size
Fail if out-of-memory
ability to make subregion read-only
Fail if subregion is not aligned
Fail if subregion size is not multiple of page size
ability to make subregion execute-read
Fail if subregion is not aligned
Fail if subregion size is not multiple of page size
ability to make subregion read-write
Fail if subregion is not aligned
Fail if subregion size is not multiple of page size
should unmap region on Drop
OPTIONAL fill region with guard pattern in debug mode?
And of course the type should expose as_ptr, as_slice etc. accessor methods so we can actually get to the underlying memory.
This should be relatively straightforward to implement since all of the required functionality already exists in the kmm crate. This is issue is just about creating a friendly and harder to abuse wrapper!
The text was updated successfully, but these errors were encountered:
Implement a RAII memory mapping primitive that allows us to manage virtual memory associated with WASM instances. In essence this should behave like a wrapper around
mmap_anonymous
, so things the type must support:mmap(2)
withMAP_FIXED_NOREPLACE | MAP_ANONYMOUS
where theptr
andlen
arg correspond to the range.mmap(2)
withMAP_FIXED_NOREPLACE | MAP_ANONYMOUS
where theptr
isNULL
andlen
is the range length.And of course the type should expose
as_ptr
,as_slice
etc. accessor methods so we can actually get to the underlying memory.This should be relatively straightforward to implement since all of the required functionality already exists in the
kmm
crate. This is issue is just about creating a friendly and harder to abuse wrapper!The text was updated successfully, but these errors were encountered: