Buffer Overflow Detection via Assertion Synthesis and K-Induction
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
2Reliability
If existing buffer overflow detection methods are applied, then detection capability is provided, but computational efficiency and scalability are poor
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.
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.
Data Source
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.


