Skip to content

Commit 8a134c9

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.
2 parents 08ad9af + ae23852 commit 8a134c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/opcache/shared_alloc_mmap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
5252
/* allows tracking segments via tools such as vmmap */
5353
fd = VM_MAKE_TAG(251U);
5454
#endif
55+
#ifdef PROT_MAX
56+
flags |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC);
57+
#endif
5558
#ifdef MAP_HUGETLB
5659
size_t huge_page_size = 2 * 1024 * 1024;
5760

0 commit comments

Comments
 (0)