Stack Frame Checksum Verification for Return Address Integrity
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing computer systems are vulnerable to stack-based attacks such as argument corruption and return address corruption, which can lead to malicious code execution.
Innovation Solution
A method is introduced to enhance stack security by generating and verifying checksums for stack frames. This involves pushing a return address onto the stack, generating a checksum, updating it with specific opcodes, and verifying it before executing certain opcodes, particularly when the return address is popped from the stack.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If stack frames are used to store return addresses and parameters during subroutine execution, then program functionality is enabled, but vulnerability to stack-based attacks (argument corruption and return address corruption) increases
Solution Approach 1:
The patent applies preliminary action by generating a checksum for the stack frame when the return address is pushed onto the stack, before any potential corruption can occur. This checksum is then updated as parameters are modified and verified before the return address is popped, preventing attacks by detecting corruption in advance.
Solution Approach 2:
The patent implements feedback through checksum verification. The checksum is continuously updated as stack parameters are modified and verified before critical operations (popping return address). This feedback mechanism detects any corruption caused by buffer overflow or laser faults, allowing the system to respond to and prevent malicious attacks.
2Reliability
If checksum verification is performed before popping the return address, then attack detection capability is improved, but execution time increases
Solution Approach 1:
The checksum verification is performed as a preliminary action before the return address is popped from the stack. This timing ensures that any corruption is detected before it can be exploited, while the verification is integrated into the existing stack management flow to minimize additional execution time.
Solution Approach 2:
The checksum is continuously updated as stack parameters are modified during subroutine execution, rather than being recalculated from scratch. This continuous updating maintains accuracy while reducing the computational overhead of verification, thereby minimizing execution time loss.
3Reliability
If checksums are generated and updated for each stack operation, then stack integrity is protected, but computational overhead increases
Solution Approach 1:
The patent applies local quality by generating checksums specifically for stack frames that contain return addresses and critical parameters, rather than for all memory operations. The checksum is updated only when specific opcodes (push, load, pop) are detected, focusing protection resources on critical areas and reducing overall computational overhead.
Solution Approach 2:
The checksum is updated by adding or subtracting parameter values based on the opcode type, rather than performing full recalculation. This parameter-based updating approach maintains integrity while significantly reducing the computational complexity compared to complete checksum recalculation for each operation.
Data Source
AI summary
The present invention relates to a method for protecting a program in a computer system, the method comprising:when a subroutine of said program is called, pushing a return address on to a stack to start forming a stack frame;when pushing said return address, generating a checksum for said stack frame;each time a predetermined opcode is detected for said subroutine, updating said checksum according to an operand associated with said predetermined opcode;if the predetermined opcode is a pop opcode, in addition to said updating, determining whether the operand associated with said pop opcode is said return address;if it is determined that said operand is said return address, verifying said checksum before executing said predetermined opcode in order to detect an attack.


