Shadow Stack Verified Stack Trace Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Debugging in cloud or server environments is inefficient due to corruption or loss of return addresses on the stack, leading to substantial processing resource consumption and difficulty in identifying bugs, especially when dealing with large data quantities.
Innovation Solution
A verified stack trace is generated using a hardware-protected shadow stack, which allows for direct retrieval of correct return addresses without unwinding the traditional call stack, reducing computational effort and storage requirements.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional call stack unwinding is performed to obtain return addresses for debugging, then stack trace information can be obtained, but processing resources are substantially consumed and data may be corrupted or missing
Solution Approach 1:
The shadow stack pre-stores return addresses in a protected location before the traditional stack is potentially corrupted. This preliminary action ensures that correct return address data is available when debugging is needed, eliminating the need to unwind the potentially corrupted traditional stack and thereby improving both data integrity and debugging efficiency.
Solution Approach 2:
The shadow stack acts as an intermediary structure that maintains a separate, protected copy of return addresses. Instead of directly accessing the potentially corrupted traditional stack, the debugging process accesses the shadow stack as an intermediate source of reliable return address data, resolving the contradiction between data integrity and access efficiency.
2Loss of information
If large quantities of data dumps are collected for later debugging analysis, then comprehensive bug information can be obtained, but substantial processing resources are consumed during triage and analysis
Solution Approach 1:
The shadow stack extracts and isolates only the critical return address information into a separate, protected structure. When debugging, only this extracted shadow stack data needs to be analyzed rather than processing entire data dumps, significantly reducing processing resource consumption while maintaining the essential bug information needed for effective debugging.
3Ease of operation
If repeated unwinding operations are performed to generate return addresses from stack traces, then debugging information can be obtained, but processor cycles are consumed and inefficiencies are introduced
Solution Approach 1:
Return addresses are pre-stored in the shadow stack during normal execution in a ready-to-use format. When debugging is needed, these pre-prepared return addresses can be directly accessed without performing time-consuming unwinding operations, thereby maintaining ease of debugging access while eliminating processing time losses.
Data Source
Figure 1a
Figure 1b
Figure 2
AI summary
A verified stack trace can be generated by utilizing information contained in a shadow stack, such as a hardware protected duplicate stack implemented for malware prevention and computer security. The shadow stack contains return addresses which are obtainable without requiring an unwinding of the traditional call stack. As such, triaging based on return address information can be performed more quickly and more efficiently, and with a reduced utilization of processing resources. Additionally, the generation of a verified stack trace can be performed, with such a verified stack trace containing return addresses that are known to be correct and not corrupted. The return addresses can either be read from the traditional call stack, or derived therefrom, and then verified by comparison to corresponding return addresses from the shadow stack, or they can be read directly from the shadow stack.