Commit 48c6b63c23e for php

commit 48c6b63c23ef14dabf0bf18ca6c7cc68f7c8049f
Merge: 0e5694756fc 9e53e04dda9
Author: Arnaud Le Blanc <arnaud.lb@gmail.com>
Date:   Mon Nov 16 15:37:29 2026 +0100

    Merge branch 'PHP-8.5' into PHP-8.6

    * PHP-8.5:
      Fix opcache.enable_file_override lookups racing with OPcache restarts (#25483)

diff --cc NEWS
index 17be7f4a920,2456029cfbe..cca27c2d71c
--- a/NEWS
+++ b/NEWS
@@@ -95,18 -73,13 +95,20 @@@ PH
    . Fixed use-after-free in JIT when the error handler releases a string while
      an "Undefined variable" warning is raised for its offset in ?? or nested
      isset()/empty(). (Jorg Sowa)
 -  . Fixed bug GH-24622 (Tracing JIT skips spilling inherited register values
 -    before property helpers). (ndossche, Alessio Attilio)
    . Fixed bug GH-8739 (OPcache restart corrupts SHM in threaded SAPIs).
      (pavimus)
+   . Fixed opcache.enable_file_override lookups racing with OPcache restarts
+     (pavimus)

 +- OpenSSL:
 +  . Fixed bug GH-25172 (TLS session reuse shares request-lifetime callback
 +    structures with persistent streams). (cxxz16, David Carlier)
 +  . Fixed an exception thrown by the session_get_cb stream context callback
 +    being replaced with a TypeError. (Ilia Alshanetsky)
 +  . Fixed use-after-free when a stream is closed by the callback for
 +    `early_data_cb`, `psk_client_cb`, `psk_server_cb`, `session_get_cb`, or
 +    `session_new_cb`. (DanielEScherzer)
 +
  - PDO_Firebird:
    . Fixed stack buffer overflow with long connection user names, passwords,
      charsets, or roles. (Ilia Alshanetsky)
diff --cc ext/opcache/zend_accelerator_module.c
index 2c290d8d5f8,8bdcae8b226..06f3f034503
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@@ -376,9 -379,15 +376,15 @@@ ZEND_INI_BEGIN(
  #endif
  ZEND_INI_END()

 -static int filename_is_in_cache(zend_string *filename)
 +static bool filename_is_in_cache(zend_string *filename)
  {
  	zend_string *key;
 -	int ret = 0;
++	bool ret = 0;
+
+ 	/* The hash may be cleaned by a restart: only look it up while holding the read lock */
+ 	if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
 -		return 0;
++		return false;
+ 	}

  	key = accel_make_persistent_key(filename);
  	if (key != NULL) {
@@@ -386,22 -395,23 +392,22 @@@
  		if (persistent_script && !persistent_script->corrupted) {
  			if (ZCG(accel_directives).validate_timestamps) {
  				zend_file_handle handle;
- 				bool ret;

  				zend_stream_init_filename_ex(&handle, filename);
 -				ret = validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS
 -					? 1 : 0;
 +				ret = validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS;
  				zend_destroy_file_handle(&handle);
- 				return ret;
+ 			} else {
 -				ret = 1;
++				ret = true;
  			}
-
- 			return true;
  		}
  	}

- 	return false;
+ 	accelerator_shm_read_unlock();
+
+ 	return ret;
  }

 -static int filename_is_in_file_cache(zend_string *filename)
 +static bool filename_is_in_file_cache(zend_string *filename)
  {
  	zend_string *realpath = zend_resolve_path(filename);
  	if (!realpath) {