enarx-archive / sallyport

API for the hypervisor-microkernel boundary
Apache License 2.0
7 stars 6 forks source link

feat: default mremap() implementation #145

Closed haraldh closed 2 years ago

haraldh commented 2 years ago

A simple fallback implementation, which just unmaps or copies over data to a newly mapped region.

Signed-off-by: Harald Hoyer harald@profian.com

rvolosatovs commented 2 years ago

We should also remove https://github.com/enarx/sallyport/blob/5f0fbbec569c8712b376ac351c889d6982067ca4/tests/integration_tests/mod.rs#L126-L135 and test the behavior if possible (or at least that it does not panic)

rvolosatovs commented 2 years ago

Also, we should check that old_address is page-aligned and that old_size > 0, due to

If the value of old_size is zero, and old_address refers to a shareable mapping (see mmap(2) MAP_SHARED), then mremap() will create a new mapping of the same pages.