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

Move the dummy function of call_attribute_constructor onto the VM stack #2446

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Jan 2, 2024

Description

Fixes possible crashes on old versions by ensuring that attribute constructor dummy functions are always on the VM stack.
(essentially works around https://bugs.php.net/bug.php?id=81430, which happens to crash more often for users now, given that Symfony started using PHP attributes.)

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@bwoebi bwoebi added the c-extension Apply this label to issues and prs related to the C-extension label Jan 2, 2024
@bwoebi bwoebi added this to the 0.97.0 milestone Jan 2, 2024
@bwoebi bwoebi requested a review from a team as a code owner January 2, 2024 17:58
@github-actions github-actions bot removed this from the 0.97.0 milestone Jan 2, 2024
Copy link
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

I don't understand dd_patch_zend_call_known_function. My assembly is poor and I'll keep looking at it, but can you explain these numbers?

ext/ddtrace.c Outdated Show resolved Hide resolved
ext/ddtrace.c Outdated Show resolved Hide resolved
@bwoebi bwoebi force-pushed the bob/trampoline_zend_call_known_function branch from 338f674 to 6fc83d6 Compare January 3, 2024 12:06
Copy link
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

I've gone through the assembly, and I'm pretty sure I understand it, and it "seems" correct.

I'm pretty nervous, though. There are a lot of assumptions here that seem like they could get violated depending on how their PHP was compiled.

Are the affected operating systems still not patching this? Which operating systems are affected? Maybe we should be pushing them to upgrade or pull in patches?

Consider this a soft-approval. If anyone like Pierre wants to take this approach, and they understand the risks here, then feel free, I won't block. I just question if there's an alternative.

@bwoebi bwoebi force-pushed the bob/trampoline_zend_call_known_function branch from 6fc83d6 to 0c4943a Compare January 16, 2024 12:26
@bwoebi bwoebi force-pushed the bob/trampoline_zend_call_known_function branch from 0c4943a to 001ca15 Compare January 16, 2024 12:26
@bwoebi bwoebi merged commit 6fc482a into master Jan 17, 2024
574 of 576 checks passed
@bwoebi bwoebi deleted the bob/trampoline_zend_call_known_function branch January 17, 2024 15:23
@github-actions github-actions bot added this to the 0.97.0 milestone Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-extension Apply this label to issues and prs related to the C-extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants