Binary Rewriting to Remove Unused Instructions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current security measures, such as ASLR and CFI, are insufficient to prevent code-reuse attacks as they can be circumvented, and existing techniques like Linux kernel specialization require source code and recompilation, leading to performance overhead and precision issues.
Innovation Solution
The method involves determining and removing unused instructions from a target application binary before and after runtime execution to reduce the binary attack surface area, using binary rewriting techniques that do not require source code or recompilation, thereby preventing code-reuse attacks by limiting accessible code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If security measures like ASLR and CFI are implemented, then protection against some attacks is improved, but they can still be circumvented by code-reuse attacks
Solution Approach 1:
The patent extracts and removes unused instructions from the binary codebase, separating them from the executable code. This extraction reduces the attack surface by eliminating potential gadgets that attackers could reuse, while preserving the functionality of used instructions.
Solution Approach 2:
The patent performs preliminary analysis to identify unused instructions before execution, and then removes them in advance. This preliminary action prevents code-reuse attacks by ensuring that potentially exploitable instructions are eliminated before an attacker can exploit them.
2Object-affected harmful factors
If Linux kernel specialization techniques are used to remove unused code, then attack surface is reduced, but source code and recompilation are required causing performance overhead
Solution Approach 1:
The patent replaces the mechanical process of source code modification and recompilation with a binary rewriting approach. Instead of modifying source code and recompiling (which causes performance overhead), the system directly rewrites the binary to remove unused instructions, achieving the same security goal without the performance penalty.
3Reliability
If existing security hardening efforts are implemented, then basic protection is improved, but precision is insufficient allowing attacks to circumvent defenses
Solution Approach 1:
The patent implements a feedback mechanism by monitoring binary execution to identify which instructions are actually used. This feedback information is then used to make precise decisions about which instructions to remove, ensuring that only truly unused instructions are eliminated while preserving all necessary functionality.
Solution Approach 2:
The patent changes the parameter of code accessibility by dynamically determining and removing unused instructions based on execution analysis. This parameter change transforms the binary from having a static attack surface to having a dynamically reduced attack surface, improving precision in preventing code-reuse attacks.
4Adaptability or versatility
If all instructions are kept accessible in the binary, then functionality is preserved, but attack surface area increases making the system more vulnerable
Solution Approach 1:
The patent extracts unused instructions from the binary and removes them, separating the functional code from the non-functional code. This extraction maintains the adaptability and versatility of the binary by preserving all used instructions while eliminating the attack surface composed of unused instructions.
Data Source
AI summary
Unused instructions and no longer used instructions in a target application binary are determined. The target application binary is rewritten before and after runtime execution of the target application binary to remove the unused and no longer used instructions to reduce binary attack surface area for the runtime execution of the target application binary. Methods, computer systems, and computer program products are disclosed.


