about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-07-13 10:07:39 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-07-13 10:07:39 +0200
commit3d33713c2b22b9d697698275a9c9dab5c8ba5d03 (patch)
tree6b35bb13ce0468a04560a8bb3b1fc1200e075e65 /src
parentebf698fdb67ea1641429aed4bc1d68da511fb51f (diff)
downloadbox64-3d33713c2b22b9d697698275a9c9dab5c8ba5d03.tar.gz
box64-3d33713c2b22b9d697698275a9c9dab5c8ba5d03.zip
Fixed some issue on tracking when protecting memory with PROT=0
Diffstat (limited to 'src')
-rw-r--r--src/custommem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/custommem.c b/src/custommem.c
index d96a38be..3f650485 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1260,8 +1260,10 @@ void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot)
     size = ALIGN(size);
     LOCK_PROT();
     rb_set(mmapmem, addr, addr+size, 1);
-    if(!prot)
+    if(!prot) {
         rb_set(mapallmem, addr, addr+size, 1);
+        rb_unset(memprot, addr, addr+size);
+    }
     UNLOCK_PROT();
     if(prot)
         setProtection(addr, size, prot);
@@ -1276,6 +1278,7 @@ void setProtection_elf(uintptr_t addr, size_t size, uint32_t prot)
     else {
         LOCK_PROT();
         rb_set(mapallmem, addr, addr+size, 1);
+        rb_unset(memprot, addr, addr+size);
         UNLOCK_PROT();
     }
 }