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.
翻译:有些程序中的错误无法通过程序输入来暴露出来,只能通过某些程序环境。在执行过程中,大多数程序访问各种资源(如数据库,文件或设备),这些资源是程序的环境的一部分。在本文中,我们提出了一种基于覆盖率引导、基于变异的环境合成方法来寻找引发错误的程序环境。具体来说,我们观察到程序通过专用的系统调用来与其环境进行交互,并建议截取这些系统调用,以便捕获输入首次执行时访问的资源作为初始程序环境, 并在随后的执行中突变这些资源的副本,以生成略微更改的程序环境。任何导致覆盖范围增加的生成环境都将添加到环境种子库,并成为进一步模糊处理的对象。错误引发的程序环境将向用户报告。实验展示了我们方法的有效性。我们实现了一个名为AFLChaos的原型,该原型在基准集中的七(7)个开源项目中的五(5)个项目 (包括OpenSSL)中发现了资源处理代码的错误。自动生成的环境包括用于存储信息的错误引导数据库,用于流式传输的错误引导的多媒体文件,用于加密的错误引导密码密钥以及用于配置程序的错误引导配置文件。为支持开放科学,我们发布了实验基础设施,我们的工具和所有数据。