Skip to content

Commit

Permalink
Merge pull request #2402 from yingcong-wu/yc/1202-mmap-failure
Browse files Browse the repository at this point in the history
[DevASAN][CPU] bugfix for mmap return value check.
  • Loading branch information
aarongreig authored Dec 26, 2024
2 parents 259b67d + d2c0451 commit 93fc133
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ uptr MmapNoReserve(uptr Addr, uptr Size) {
Addr = RoundDownTo(Addr, EXEC_PAGESIZE);
void *P = mmap((void *)Addr, Size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS, -1, 0);
if (P == MAP_FAILED) {
return 0;
}
return (uptr)P;
}

Expand Down

0 comments on commit 93fc133

Please sign in to comment.