Binary Rewriting to Remove Unused Instructions

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvesecurity protectionVSAvoidcode-reuse attack vulnerability
Core Design Contradiction:
ReliabilityVSObject-affected harmful factors

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.

Inventive Principle:
Principle #2Taking out (Extraction)

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.

Inventive Principle:
Principle #10Preliminary action

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

Engineering Contradiction:
Improvebinary attack surface areaVSAvoidsystem performance
Core Design Contradiction:
Object-affected harmful factorsVSProductivity

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

3Reliability

If existing security hardening efforts are implemented, then basic protection is improved, but precision is insufficient allowing attacks to circumvent defenses

Engineering Contradiction:
Improvesecurity hardeningVSAvoidattack detection precision
Core Design Contradiction:
ReliabilityVSMeasurement precision

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.

Inventive Principle:
Principle #23Feedback

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.

Inventive Principle:
Principle #35Parameter changes

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

Engineering Contradiction:
Improvebinary functionalityVSAvoidcode-reuse attack risk
Core Design Contradiction:
Adaptability or versatilityVSObject-affected harmful factors

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.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS11262993B2Application binary rewriting to reduce binary attack surface area
Publication Date: 2022.03.01 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US11262993B2 patent drawing
  • US11262993B2 patent drawing
  • US11262993B2 patent drawing

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.