Changes between Initial Version and Version 2 of Ticket #57050
- Timestamp:
- 11/09/2022 09:19:13 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #57050
- Property Component Security → Bootstrap/Load
- Property Focuses coding-standards removed
- Property Keywords changes-requested removed
- Property Version 6.1 → 3.0
-
Ticket #57050 – Description
initial v2 12 12 For quite some time, ASL has been reporting the following error code hundreds of times a day … 13 13 14 60027 : Denied a RWX mmap event. An application just attempted to use the mprotect function to bypass memory protection functions in the kernel.14 60027 : Denied a RWX mmap event. An application just attempted to use the mprotect function to bypass memory protection functions in the kernel. 15 15 16 16 I have contacted Atomic support several times over this issue but the problem is not with their software, it is doing what it is supposed to do. ASL uses their own custom kernel that would deny attempts to bypass memory protection. 17 17 18 So, digging a little deeper, I find this in my server logs at :18 So, digging a little deeper, I find this in my server logs at `/var/log/plesk-php74-fpm/error.log`: 19 19 20 /var/log/plesk-php74-fpm/error.log 21 22 WARNING: [pool xxxxxxxxx.ca] child 23848 said into stderr: “PHP message: PHP Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /var/www/vhosts/xxxxxxxxx.ca/httpdocs/wp-includes/load.php on line 43” 20 WARNING: [pool xxxxxxxxx.ca] child 23848 said into stderr: “PHP message: PHP Warning: preg_match(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 in /var/www/vhosts/xxxxxxxxx.ca/httpdocs/wp-includes/load.php on line 43” 23 21 24 22 So, every time any of the domains on my server loads, this error is generated. 25 23 26 Looking at the file wp-includes/load.php, here is the errant code ((note lines 42 and 43 as marked)24 Looking at `wp_fix_server_vars()` in [https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes/load.php#L42-L43 wp-includes/load.php], here is the errant code at lines 42-43: 27 25 28 function wp_fix_server_vars() { 29 global $PHP_SELF; 26 {{{#!php 27 <?php 30 28 31 $default_server_values = array( 32 'SERVER_SOFTWARE' => '', 33 'REQUEST_URI' => '', 34 ); 35 36 $_SERVER = array_merge( $default_server_values, $_SERVER ); 37 38 Line 42 // Fix for IIS when running with PHP ISAPI. 39 Line 43 if ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { 40 41 if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) { 42 // IIS Mod-Rewrite. 43 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; 44 } elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { 45 // IIS Isapi_Rewrite. 46 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; 47 } else { 48 // Use ORIG_PATH_INFO if there is no PATH_INFO. 49 if ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) { 50 $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; 51 } 52 53 // Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice). 54 if ( isset( $_SERVER['PATH_INFO'] ) ) { 55 if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) { 56 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; 57 } else { 58 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; 59 } 60 } 61 62 // Append the query string if it exists and isn't null. 63 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { 64 $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; 65 } 66 } 29 // Fix for IIS when running with PHP ISAPI. 30 if ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { 31 }}}
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)