linux: make use of mseal(2)

Instead of protecting the global read-only data structure after startup
via the read-only flag, which can be reverted, use the in Linux 6.10
introduced irreversible syscall mseal(2).
This commit is contained in:
Christian Göttsche 2024-07-24 17:20:07 +02:00
parent 749640c274
commit 96836f463b
3 changed files with 24 additions and 0 deletions

View file

@ -19,6 +19,7 @@ bool memory_unmap(void *ptr, size_t size);
bool memory_protect_ro(void *ptr, size_t size);
bool memory_protect_rw(void *ptr, size_t size);
bool memory_protect_rw_metadata(void *ptr, size_t size);
bool memory_protect_seal(void *ptr, size_t size);
#ifdef HAVE_COMPATIBLE_MREMAP
bool memory_remap(void *old, size_t old_size, size_t new_size);
bool memory_remap_fixed(void *old, size_t old_size, void *new, size_t new_size);