Delayed effects 2#213
Conversation
This is a prototype for fixing a long-standing source of interrupt vulnerabilities: A notice is emitted during execution of an opcode, resulting in an error handling being run. The error handler modifies some data structure the opcode is working on, resulting in UAF or other memory corruption. The idea here is to instead collect notices and only process them after the opcode. This is implemented similarly to exception handling, by switching to a ZEND_HANDLE_DELAYED_ERROR opcode, which will then switch back to the normal opcode stream. Unfortunately, what this prototype implements is not sufficient. Opcodes that acquire direct (INDIRECT) references to zvals require that no interrupts occur between the producing and the consuming opcode. Chains of W/RW opcodes should be executed without interrupt. Currently, the notice is only delayed until after the first opcode, which still results in an illegal interrupt (bug78598.phpt shows a UAF with this change). I'm not sure how to best handle that issue.
There are 3 categories of failing tests here: - Many are throwing in a user error handlers, therefore relied on non-delayed behavior. Fixed these by installing the error handler with promote_to_exception: true. - Some are just printing the error message. Their output changes due to delay. These are fixed by updating the EXPECT section. - And finally, many are testing the adverse effects of mutations in error handlers. These are now irrelevant, but these are also fixed by updating the EXPECT section.
…_call_frame slow path
|
Important Review skippedToo many files! This PR contains 244 files, which is 94 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (244)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai help |
ChatThere are 3 ways to chat with CodeRabbit:
CodeRabbit commands
Other keywords and placeholders
CodeRabbit configuration file (
|
|
@CodeRabbit review --dir Zend |
|
Tip For best results, initiate chat on the files or code changes.
If you'd like to focus reviews on the reviews:
path_instructions:
- path: "Zend/**"
instructions: "Focus the review on this directory."You can find more details in the path-based instructions documentation. In the meantime, shall I trigger a full review of the PR? |
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
No description provided.