Message ID | 20210313094747.2966948-6-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
Series | [PULL,1/5] linux-user: Fix executable page of /proc/self/maps | expand |
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e525901659d4..c6731013fde2 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2235,7 +2235,8 @@ static uintptr_t pgb_find_hole(uintptr_t guest_loaddr, uintptr_t guest_size, brk = (uintptr_t)sbrk(0); if (!maps) { - return pgd_find_hole_fallback(guest_size, brk, align, offset); + ret = pgd_find_hole_fallback(guest_size, brk, align, offset); + return ret == -1 ? -1 : ret - guest_loaddr; } /* The first hole is before the first map entry. */