Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102540433
D33070.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
D33070.diff
View Options
diff --git a/tests/sys/kern/coredump_phnum_helper.c b/tests/sys/kern/coredump_phnum_helper.c
--- a/tests/sys/kern/coredump_phnum_helper.c
+++ b/tests/sys/kern/coredump_phnum_helper.c
@@ -42,18 +42,21 @@
main(int argc __unused, char **argv __unused)
{
void *v;
- unsigned i;
+ size_t i, pages;
- for (i = 0; i < UINT16_MAX + 1000; i++) {
+ pages = UINT16_MAX + 1000;
+ v = mmap(NULL, pages * PAGE_SIZE, PROT_READ | PROT_WRITE,
+ MAP_ANON | MAP_PRIVATE, -1, 0);
+ if (v == NULL)
+ err(1, "mmap");
+ for (i = 0; i < pages; i += 2) {
/*
- * Alternate protections; otherwise the kernel will just extend
- * the adjacent same-protection previous mapping.
+ * Alternate protections to interleave RW and R PT_LOAD
+ * segments.
*/
- v = mmap(NULL, PAGE_SIZE,
- (((i % 2) == 0) ? PROT_READ : 0) | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE, -1, 0);
- if (v == MAP_FAILED)
- err(1, "mmap");
+ if (mprotect((char *)v + i * PAGE_SIZE, PAGE_SIZE,
+ PROT_READ) != 0)
+ err(1, "mprotect");
}
/* Dump core. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 7:27 PM (6 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14632787
Default Alt Text
D33070.diff (1 KB)
Attached To
Mode
D33070: Fix coredump_phnum test with ASLR enabled by default
Attached
Detach File
Event Timeline
Log In to Comment