Call Stack Acquisition via Control Flow Validation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional techniques fail to accurately reproduce a call stack containing a function call without frame pointers, limiting their application to programs with debug symbols or monitored environments, and risk incorrect detection of function pointers as return addresses.
Innovation Solution
A call stack acquisition device that extracts possible return addresses from a memory space and analyzes control flows to determine valid return addresses, avoiding errors in detection by examining the relationship between function calls and execution commands.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If general stack tracing technique is used to acquire return addresses by tracing frame pointers, then call stack can be reproduced, but it fails when frame pointers are not used due to compiler optimization or 64 bit Windows execution environment
Solution Approach 1:
The patent introduces control flow information as an intermediary to bridge the gap between stack data and function call relationships. When frame pointers are unavailable, the system uses control flow graphs and return address validation mechanisms to infer call stack relationships, enabling accurate analysis across different execution environments including those without frame pointers
Solution Approach 2:
The patent changes the approach from relying on frame pointer parameters to using control flow graph parameters and return address validation. By shifting from frame pointer-based tracing to control flow-based analysis, the system adapts to environments where frame pointers are optimized away while maintaining call stack reproduction accuracy
2Adaptability or versatility
If scanning return addresses in the stack is used to reproduce call stack without frame pointers, then call stack can be reproduced, but function pointers may be incorrectly detected as return addresses
Solution Approach 1:
The patent implements feedback mechanisms through control flow graph validation and return address verification. Each detected return address is validated against the control flow graph to confirm it actually represents a valid function return, providing feedback that eliminates false positives from function pointers while maintaining the ability to handle programs without frame pointers
Solution Approach 2:
The patent replaces the mechanical approach of directly scanning for return addresses with a more sophisticated system that uses control flow analysis and validation algorithms. This substitution of mechanical scanning with intelligent validation significantly improves precision while maintaining versatility
3Measurement precision
If debug symbols are used to reproduce call stack, then accurate call stack can be obtained, but the technique is limited to programs capable of acquiring debug symbols and cannot be applied to release builds or malware
Solution Approach 1:
The patent extracts the essential functionality of call stack reproduction away from its dependency on debug symbols. By removing the requirement for debug symbols and building call stack analysis on fundamental stack data and control flow graphs, the system can accurately reproduce call stacks across all program types including release builds and malware without requiring any special program modifications
Data Source
AI summary
For the purpose of reproducing a call stack accurately without restricting the range of application, a stack scanner extracts, from a stack area of a thread whose call stack is to be acquired in a memory space of an application process, possible return addresses that are addresses in a feasible region in the memory space each representing a command right after a function call command. A program analyzer analyzes a control flow representing a flow of control configured by a branch in a function that is called by the function call command right before the command represented by each of the possible return addresses and, when there is a route reaching a command currently being executed in the control flow, determines that the possible return address is a return address and, when there is not the route, determines that the possible return address is not a return address.


