Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144369660
D33070.id98798.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1021 B
Referenced Files
None
Subscribers
None
D33070.id98798.diff
View Options
Index: tests/sys/kern/coredump_phnum_helper.c
===================================================================
--- tests/sys/kern/coredump_phnum_helper.c
+++ tests/sys/kern/coredump_phnum_helper.c
@@ -42,18 +42,19 @@
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;
+ if (posix_memalign(&v, PAGE_SIZE, pages * PAGE_SIZE) != 0)
+ err(1, "posix_memalign");
+ 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 + 1) * PAGE_SIZE, PAGE_SIZE,
+ PROT_READ) != 0)
+ err(1, "mprotect");
}
/* Dump core. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 2:25 AM (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28526027
Default Alt Text
D33070.id98798.diff (1021 B)
Attached To
Mode
D33070: Fix coredump_phnum test with ASLR enabled by default
Attached
Detach File
Event Timeline
Log In to Comment