Back to Search Start Over

Concretely Mapped Symbolic Memory Locations for Memory Error Detection

Authors :
Tu, Haoxin
Jiang, Lingxiao
Hong, Jiaqi
Ding, Xuhua
Jiang, He
Source :
IEEE Transactions on Software Engineering; 2024, Vol. 50 Issue: 7 p1747-1767, 21p
Publication Year :
2024

Abstract

Memory allocation is a fundamental operation for managing memory objects in many programming languages. Misusing allocated memory objects (e.g., buffer overflow and use-after-free) can have catastrophic consequences. Symbolic execution-based approaches have been used to detect such memory errors, benefiting from their capabilities in automatic path exploration and test case generation. However, existing symbolic execution engines still suffer from fundamental limitations in modeling dynamic memory layouts; they either represent the locations of memory objects as concrete addresses and thus limit their analyses only to specific address layouts and miss errors that may only occur when the objects are located at special addresses, or represent the locations as simple symbolic variables without sufficient constraints and thus suffer from memory state explosion when they execute read/write operations involving symbolic addresses. Such limitations hinder the existing symbolic execution engines from effectively detecting certain memory errors. In this study, we propose <sc>SymLoc</sc>, a symbolic execution-based approach that uses concretely mapped symbolic memory locations to alleviate the limitations mentioned above. Specifically, a new integration of three techniques is designed in <sc>SymLoc</sc>: (1) the symbolization of addresses and encoding of symbolic addresses into path constraints, (2) the symbolic memory read/write operations using a symbolic-concrete memory map, and (3) the automatic tracking of the uses of symbolic memory locations. We build <sc>SymLoc</sc> on top of the well-known symbolic execution engine KLEE and demonstrate its benefits in terms of memory error detection and code coverage capabilities. Our evaluation results show that: for address-specific spatial memory errors, <sc>SymLoc</sc> can detect 23 more errors in <monospace>GNU Coreutils</monospace>, <monospace>Make</monospace>, and <monospace>m4</monospace> programs that are difficult for other approaches to detect, and cover 15% and 48% more unique lines of code in the programs than two baseline approaches; for temporal memory errors, <sc>SymLoc</sc> can detect 8%-64% more errors in the Juliet Test Suite than various existing state-of-the-art memory error detectors. We also present two case studies to show sample memory errors detected by <sc>SymLoc</sc> along with their root causes and implications.

Details

Language :
English
ISSN :
00985589
Volume :
50
Issue :
7
Database :
Supplemental Index
Journal :
IEEE Transactions on Software Engineering
Publication Type :
Periodical
Accession number :
ejs66962774
Full Text :
https://doi.org/10.1109/TSE.2024.3395412