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

寻找诱发 Bug 的程序环境

Finding Bug-Inducing Program Environments

Zahra Mirzamomen, Marcel Böhme

AI总结:

本文提出覆盖率引导的系统调用拦截与环境资源变异方法,并通过 AFLChaos 在多个开源项目中自动发现资源处理相关 Bug。

摘要:

有些 Bug 无法通过程序输入暴露,而只能由特定的程序环境触发。在执行过程中,大多数程序会访问程序外部的各种资源,例如数据库、文件或设备,这些资源因此构成程序环境的一部分。本文提出一种覆盖率引导、基于变异的环境合成方法,用于生成诱发 Bug 的程序环境。具体而言,我们观察到程序通过专用系统调用与其环境交互,因此建议拦截这些系统调用:(i)捕获输入首次执行期间访问的资源,作为初始程序环境;(ii)在该输入的后续执行过程中变异这些资源的副本,以生成略有变化的程序环境。任何被观察到能够提高覆盖率的生成环境都会被加入环境种子语料库,并成为进一步模糊测试的对象。诱发 Bug 的程序环境会被报告给用户。实验证明了该方法的有效性。我们实现了名为 AFLChaos 的原型,在基准集中七个开源项目中的五个(包括 OpenSSL)的资源处理代码中发现了 Bug。AFLChaos 自动生成了多种环境,包括用于存储信息且会诱发 Bug 的数据库、用于流媒体播放且会诱发 Bug 的多媒体文件、用于加密且会诱发 Bug 的密钥,以及用于配置程序且会诱发 Bug 的配置文件。为支持开放科学,我们公开了实验基础设施、工具和所有数据。

英文摘要:

Some bugs cannot be exposed by program inputs, but only by certain program environments. During execution, most programs access various resources, like databases, files, or devices, that are external to the program and thus part of the program's environment. In this paper, we present a coverage-guided, mutation-based environment synthesis approach of bug-inducing program environments. Specifically, we observe that programs interact with their environment via dedicated system calls and propose to intercept these system calls (i) to capture the resources accessed during the first execution of an input as initial program environment, and (ii) mutate copies of these resources during subsequent executions of that input to generate slightly changed program environments. Any generated environment that is observed to increase coverage is added to the corpus of environment seeds and becomes subject to further fuzzing. Bug-inducing program environments are reported to the user. Experiments demonstrate the effectiveness of our approach. We implemented a prototype called AFLChaos which found bugs in the resource-handling code of five (5) of the seven (7) open source projects in our benchmark set (incl. OpenSSL). Automatically, AFLChaos generated environments consisting of bug-inducing databases used for storing information, bug-inducing multimedia files used for streaming, bug-inducing cryptographic keys used for encryption, and bug-inducing configuration files used to configure the program. To support open science, we publish the experimental infrastructure, our tool, and all data.

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

↑