arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.03555cs.CR
收藏

Empc:面向符号执行的基于路径覆盖的有效路径优先级排序

Empc: Effective Path Prioritization for Symbolic Execution with Path Cover

Shuangjie Yao, Dongdong She

AI总结:

针对符号执行路径爆炸问题,本文提出 Empc 技术,利用多个最小路径覆盖代替指数级路径进行优先级排序和搜索,在提升代码覆盖率与缺陷发现能力的同时大幅降低内存开销。

摘要:

符号执行是一种强大的程序分析技术,能够对程序行为的正确性进行形式化推理并检测软件缺陷。它可以系统地探索被测程序的执行路径,但存在一个固有局限:路径爆炸。当符号执行遇到数量庞大(随程序规模呈指数增长)且需要被符号化推理的路径时,就会发生路径爆炸。这严重影响了符号执行的可扩展性和性能。为了解决这一问题,已有工作利用各种启发式方法对符号执行路径进行优先级排序。它们使用静态规则或启发式方法对指数级数量的路径进行排序,并探索排名最高的路径。然而,在实践中,这些工作往往难以泛化到多样化的程序上。在本工作中,我们提出了一种新颖且有效的基于路径覆盖的路径优先级排序技术,命名为 Empc。我们的核心见解是:并非所有路径都需要被符号化推理。与传统路径优先级排序不同,我们的方法利用一小部分路径作为最小路径覆盖(MPC),使其能够覆盖被测程序的所有代码区域。为了在路径优先级排序中鼓励多样性,我们计算多个 MPC。随后,我们引导符号执行在多个 MPC 内的少量路径上进行搜索,而不是在指数级数量的路径上搜索。我们基于 KLEE 实现了 Empc 技术,并对 Empc 进行了全面评估,以考察其在代码覆盖率、缺陷发现和运行时开销方面的性能。评估结果表明,与 KLEE 的最佳搜索策略相比,Empc 能够多覆盖 19.6% 的基本块;与最先进的工作 cgs 相比,Empc 能够多覆盖 24.4% 的代码行。与 KLEE 的最佳搜索策略相比,Empc 还多发现了 24 个安全违规。同时,Empc 能够将 KLEE 的内存使用量显著降低最多 93.5%。

英文摘要:

Symbolic execution is a powerful program analysis technique that can formally reason the correctness of program behaviors and detect software bugs. It can systematically explore the execution paths of the tested program. But it suffers from an inherent limitation: path explosion. Path explosion occurs when symbolic execution encounters an overwhelming number (exponential to the program size) of paths that need to be symbolically reasoned. It severely impacts the scalability and performance of symbolic execution. To tackle this problem, previous works leverage various heuristics to prioritize paths for symbolic execution. They rank the exponential number of paths using static rules or heuristics and explore the paths with the highest rank. However, in practice, these works often fail to generalize to diverse programs. In this work, we propose a novel and effective path prioritization technique with path cover, named Empc. Our key insight is that not all paths need to be symbolically reasoned. Unlike traditional path prioritization, our approach leverages a small subset of paths as a minimum path cover (MPC) that can cover all code regions of the tested programs. To encourage diversity in path prioritization, we compute multiple MPCs. We then guide the search for symbolic execution on the small number of paths inside multiple MPCs rather than the exponential number of paths. We implement our technique Empc based on KLEE. We conduct a comprehensive evaluation of Empc to investigate its performance in code coverage, bug findings, and runtime overhead. The evaluation shows that Empc can cover 19.6% more basic blocks than KLEE's best search strategy and 24.4% more lines compared to the state-of-the-art work cgs. Empc also finds 24 more security violations than KLEE's best search strategy. Meanwhile, Empc can significantly reduce the memory usage of KLEE by up to 93.5%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑