read DW_OP_deref_size address through FIRCLSReadMemory - #16550
Conversation
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the DW_OP_deref_size opcode execution in the DWARF expression machine to safely read memory using FIRCLSReadMemory instead of directly dereferencing potentially invalid pointers. Additionally, it introduces unit tests to verify that valid addresses are read correctly and invalid addresses are safely rejected without causing crashes. There are no review comments, and I have no additional feedback to provide.
|
Rerunning failed CI job... |
Unvalidated memory read in DW_OP_deref_size
DW_OP_deref pops its address and reads it through
FIRCLSReadMemory, but DW_OP_deref_size dereferences the popped value directly, so a DW_CFA_expression in a frame's eh_frame can steer the crash-time unwinder into an arbitrary-address read. Routed it through the same validated read as DW_OP_deref, so valid reads are unchanged and a bad address is reported instead of faulting. Added two regression tests covering a valid read and an unreadable address.