LLNL / umap

User-space Page Management
GNU Lesser General Public License v2.1
104 stars 22 forks source link

add write_protection check in umap_ex #95

Closed IBPeng closed 5 years ago

IBPeng commented 5 years ago

It does not verify the case of having a umap library compiled with read/write mode being run on a platform supporting read-only access. This could happen quite easily if we build the umap library on one machine and then try to use it on a different machine with a standard kernel.

This is already checked in Uffd::check_uffd_compatibility (https://github.com/LLNL/umap/blob/969241d5bf18aa4126724b20b89dd92320d6ca8e/src/umap/Uffd.cpp#L316-L320) is already there to make the check (@mcfadden8 )

This verifies that if the umap library was compiled readonly, at runtime, the caller may not request PROT_WRITE. This happens in the existing example/psort, which motivates to add the check at runtime