Skip to content

Fix GH-10709: UAF in recursive AST evaluation #10718

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

Closed
wants to merge 2 commits into from

Conversation

iluuu1994
Copy link
Member

Verified

This commit was signed with the committer’s verified signature.
iluuu1994 Ilija Tovilo

Verified

This commit was signed with the committer’s verified signature.
iluuu1994 Ilija Tovilo
We already have a zend_refcounted here, checking the flags here makes more
sense. Set the GC_IMMUTABLE flag on zend_ast_ref values in shm for consistency.
@iluuu1994 iluuu1994 requested a review from dstogov February 27, 2023 16:02
Copy link
Member

@dstogov dstogov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is OK.

It's possible to avoid code duplication, by delaying check of zend_ast_evaluate() return value after if (ast_is_refcounted && !GC_DELREF(ast_ref)) { check.

@iluuu1994
Copy link
Member Author

That makes sense, I'll adjust it accordingly before merging. Thanks for the review!

@iluuu1994 iluuu1994 closed this in 7202fe1 Mar 6, 2023
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

2 participants