mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3'
* PHP-8.3: Fix GH-13903: ASAN false positive underflow when executing copy()
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
# include <sanitizer/asan_interface.h>
|
||||
# include <sanitizer/common_interface_defs.h>
|
||||
#endif
|
||||
|
||||
@@ -306,6 +307,12 @@ static void zend_fiber_stack_free(zend_fiber_stack *stack)
|
||||
|
||||
void *pointer = (void *) ((uintptr_t) stack->pointer - ZEND_FIBER_GUARD_PAGES * page_size);
|
||||
|
||||
#ifdef __SANITIZE_ADDRESS__
|
||||
/* If another mmap happens after unmapping, it may trigger the stale stack red zones
|
||||
* so we have to unpoison it before unmapping. */
|
||||
ASAN_UNPOISON_MEMORY_REGION(pointer, stack->size + ZEND_FIBER_GUARD_PAGES * page_size);
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
VirtualFree(pointer, 0, MEM_RELEASE);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user