Page MenuHomeFreeBSD

D32474.id96767.diff
No OneTemporary

D32474.id96767.diff

diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c
--- a/libexec/rtld-elf/rtld_malloc.c
+++ b/libexec/rtld-elf/rtld_malloc.c
@@ -184,7 +184,9 @@
nblks = 1;
}
if (amt > pagepool_end - pagepool_start)
- if (morepages(amt/pagesz + NPOOLPAGES) == 0)
+ if (morepages(amt / pagesz + NPOOLPAGES) == 0 &&
+ /* Retry with min required size */
+ morepages(amt / pagesz) == 0)
return;
op = (union overhead *)pagepool_start;
pagepool_start += amt;
@@ -259,7 +261,7 @@
int offset;
if (pagepool_end - pagepool_start > pagesz) {
- addr = (caddr_t)roundup2((long)pagepool_start, pagesz);
+ addr = (caddr_t)roundup2((uintptr_t)pagepool_start, pagesz);
if (munmap(addr, pagepool_end - addr) != 0) {
#ifdef IN_RTLD
rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": "
@@ -269,8 +271,10 @@
}
}
- offset = (long)pagepool_start - rounddown2((long)pagepool_start,
- pagesz);
+ if (pagepool_start == MAP_FAILED)
+ pagepool_start = 0;
+ offset = (uintptr_t)pagepool_start - rounddown2(
+ (uintptr_t)pagepool_start, pagesz);
pagepool_start = mmap(0, n * pagesz, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE, -1, 0);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 15, 11:14 AM (10 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14641293
Default Alt Text
D32474.id96767.diff (1 KB)

Event Timeline