diff --git a/src/custommem.c b/src/custommem.c index 6f1f1f90..85bf96e8 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -957,6 +957,7 @@ void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot) else { mutex_lock(&mutex_prot); rb_set(mapallmem, addr, addr+size, 1); + rb_unset(memprot, addr, addr+size); mutex_unlock(&mutex_prot); } } @@ -970,6 +971,7 @@ void setProtection_elf(uintptr_t addr, size_t size, uint32_t prot) else { mutex_lock(&mutex_prot); rb_set(mapallmem, addr, addr+size, 1); + rb_unset(memprot, addr, addr+size); mutex_unlock(&mutex_prot); } }