Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix segfault in ZEND_FUNC_GET_ARGS #12768

Merged
merged 7 commits into from Nov 24, 2023

Conversation

realFlowControl
Copy link
Contributor

@realFlowControl realFlowControl commented Nov 24, 2023

This PR is based on the work of #12758 (which should be merged before this one, as it contains all the work on zend_test)

In case a ZEND_FUNC_GET_ARGS is being executed, while the current chunk is full, the zend_new_array() call will trigger a OOM in ZendMM which will crash, as the opline might be a dangling pointer.

Commit 8a73bb5 brings the test and the fix

Florian Engelhardt and others added 7 commits November 23, 2023 16:34
In case a `ZEND_BIND_STATIC` is being executed, while the current chunk is full,
the `zend_array_dup()` call will trigger a OOM in ZendMM which will crash, as
the opline might be a dangling pointer.
In case a `ZEND_FUNC_GET_ARGS` is being executed, while the current chunk is
full, the `zend_new_array()` call will trigger a OOM in ZendMM which will crash,
as the opline might be a dangling pointer.
@bwoebi bwoebi merged commit 8d2df86 into php:PHP-8.1 Nov 24, 2023
7 checks passed
bwoebi added a commit that referenced this pull request Nov 24, 2023
@iluuu1994
Copy link
Member

This approach doesn't seem to work for USE_ZEND_ALLOC=0. We could skip that test in that case, although asan is likely the most useful job for this test. @realFlowControl Can you have a look?

@bwoebi
Copy link
Member

bwoebi commented Nov 25, 2023

@iluuu1994 can we explicitly set USE_ZEND_ALLOC=1 in the test via --ENV--?

@iluuu1994
Copy link
Member

@bwoebi That should probably work.

@realFlowControl
Copy link
Contributor Author

Yes, I too think that this should work. Is it okay if I have a look on Monday?
I have an idea how to make it work with USE_ZEND_ALLOC=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants