Buffer Overflow Detection via Assertion Synthesis and K-Induction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for detecting buffer overflows are complex and inefficient, failing to effectively identify potential buffer overflows in software due to their high complexity and poor performance.

Innovation Solution

A method and system for buffer overflow detection using assertion synthesis and k-induction verification, which captures the dependency between buffer and loop index variables to generate assertions and determine whether a buffer overflow exists, employing a staged implementation for computational efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If existing methods for detecting buffer overflows are used, then buffer overflow detection can be performed, but the complexity and computational cost are high and performance is poor

Engineering Contradiction:
Improvebuffer overflow detection accuracyVSAvoiddetection method complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The detection method is segmented into distinct phases: (1) obtaining program code and assertion templates, (2) synthesizing assertions by capturing dependencies between buffer index variables and loop index variables, (3) verifying assertions using k-induction, and (4) determining buffer overflow existence. This segmentation allows each phase to be optimized independently, reducing overall complexity while maintaining detection accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Assertion templates serve as intermediaries between the program code and the verification process. These templates capture the essential dependency relationships between buffer index variables and loop index variables without requiring full program analysis, thereby simplifying the detection process while maintaining reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If existing buffer overflow detection methods are applied, then detection capability is provided, but computational efficiency and scalability are poor

Engineering Contradiction:
Improvedetection accuracyVSAvoidcomputational efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The method performs preliminary action by synthesizing assertions that capture dependency relationships before the actual buffer overflow detection. By pre-computing and storing these assertion templates that represent typical buffer access patterns, the system avoids repeated complex analyses during detection, significantly improving computational efficiency while maintaining detection accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The verification process uses k-induction with a configurable parameter k that controls the depth of verification. By adjusting this parameter, the system can balance between thoroughness and computational efficiency, allowing scalable detection across different program sizes and complexity levels while maintaining reliable detection capability.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11030304B2Buffer overflow detection based on a synthesis of assertions from templates and k-induction
Publication Date: 2021.06.08 ORACLE INT CORP
  • US11030304B2 patent drawing
  • US11030304B2 patent drawing
  • US11030304B2 patent drawing

AI summary

A method for buffer overflow detection involves obtaining a program code configured to access memory locations in a loop using a buffer index variable, obtaining an assertion template configured to capture a dependency between the buffer index variable and a loop index variable of the loop in the program code, generating an assertion using the assertion template, verifying that the assertion holds using a k-induction; and determining whether a buffer overflow exists using the assertion.