]> granicus.if.org Git - php/commit
Fix ASLR related invalid opline handler issues
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 20 May 2019 13:59:54 +0000 (15:59 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 21 May 2019 12:33:33 +0000 (14:33 +0200)
commit8ba10b8fbc020dc225d3b19d8f088f1351a3e304
tree7ac0e0361174aa19a12f1f09cb42a2aeb03129a7
parent24206783c3cf2e41e0895ab04e8f59b8092f476a
Fix ASLR related invalid opline handler issues

Opcache stores `opline->handler`s in shared memory.  These pointers are
invalid, if the main PHP DLL is loaded at another base address due to
ASLR.  We therefore store the address of `execute_ex` in the mmap base
file, and check on startup whether it matches its current address.  If
not, we fall back on the file cache if enabled, and bail out otherwise.

This still does not address cases where the opline handler is located
inside of another DLL (e.g. for some profilers, debuggers), but there
seems to be no general solution for now.
ext/opcache/shared_alloc_win32.c