Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102588238
D32474.id96767.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32474.id96767.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D32474: crt_malloc: Be more persistent when handling mmap() failure
Attached
Detach File
Event Timeline
Log In to Comment