Skip to content

Commit

Permalink
[DYNAREC] Protect memory even if MAP_FIXED_NOREPLACE flags was not re…
Browse files Browse the repository at this point in the history
…spected
  • Loading branch information
ptitSeb committed Dec 3, 2022
1 parent 686c68a commit 8165342
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wrapped/wrappedlibc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2389,11 +2389,11 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot
if(box64_log<LOG_DEBUG) {dynarec_log(LOG_DEBUG, "%p\n", ret);}
#ifdef DYNAREC
if(box64_dynarec && ret!=(void*)-1) {
if(flags&0x100000 && addr!=ret)
/*if(flags&0x100000 && addr!=ret)
{
// program used MAP_FIXED_NOREPLACE but the host linux didn't support it
// and responded with a different address, so ignore it
} else {
} else*/ {
if(prot& PROT_EXEC)
addDBFromAddressRange((uintptr_t)ret, length);
else
Expand Down

0 comments on commit 8165342

Please sign in to comment.