Skip to content

Commit

Permalink
[scudo] Return NULL when MAP_ALLOWNOMEM is set on Trusty
Browse files Browse the repository at this point in the history
Back-ported from https://r.android.com/2591905.

Reviewed By: Chia-hungDuan

Differential Revision: https://reviews.llvm.org/D155144
  • Loading branch information
ahomescu authored and ChiaHungDuan committed Jul 25, 2023
1 parent bf89531 commit e4316a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler-rt/lib/scudo/standalone/trusty.cpp
Expand Up @@ -50,7 +50,8 @@ void *map(void *Addr, uptr Size, const char *Name, uptr Flags,

if (IS_ERR(P)) {
errno = lk_err_to_errno(PTR_ERR(P));
dieOnMapUnmapError(Size);
if (!(Flags & MAP_ALLOWNOMEM) || errno != ENOMEM)
dieOnMapUnmapError(Size);
return nullptr;
}

Expand Down

0 comments on commit e4316a5

Please sign in to comment.