
* add stub runtime that links with symcc common runtime code * implement tracing runtime to generate message file * move ShMemCursor to libafl proper * qualify enum imports to make clippy happy * fix warnings * formatting * update symcc submodule to point to AFL++ org repo * fix naming of ShMemCursor and remove std requirement * ensure runtime is named correctly after compilation * add devcontainer files for easier development (will be removed later) * move rust nightly install into devcontainer.json this makes it run after the container has been built * dev container: install recommended packages * switch to building rust runtime from SymCC cmake * install corrosion in dev container for cmake-cargo integration * add smoke test for symcc-runtime integration * update symcc submodule * add rustfmt to devcontainer * properly mark the end of a constraint trace Using a special "End" message * small tool to dump constraints from a traced process * extend smoke test to include parsing & printing of constraints * update symcc submodule * first draft of expression filters for concolic * fix type in runtime method name * update symcc submodule * implement extensions to serdeany map: * remove -> Option<T> * insert_boxed(Box<T>) (avoids allocation if value is already boxed) * implement std::io::Seek for ShMemCursor * implement framing for in-memory traces this allows to efficiently get the length of trace. this is important for efficiently copying the trace out of the shared memory region. * fix for serdeany map * fuzzer that associates concolic traces with test case * ensure runtime can handle 0-expressions * move metadata, observer and feedback into separate files * convert executor to command executor and move to separate file * refactoring and streamlining * move panic mode configuration to cmake script * compile cmake from source, because debians version is too old......... * use separate stage for tracing * fix dockerfile * move runtime into the workspace using prior work on compilation flags from cmake * actually make use of selective symbolication filter * update to support latest symcc changes * implement hitmap for concolic runtime * clippy * implement selective symbolization and coverage map for dump_constraints tool * use concolic runtime coverage for concolic fuzzer feedback * actually kill process on timeout * be extra careful after killing process * increase command executor busy wait to 5ms * implement concolic tracing stage * address naming issue * implement floating point expression filter for runtime * rename expression filters to be less verbose * implement expression pruning * implement ConcolicMutationalStage * refactor command executor and remove busy loop * implement generic command executor * remove debug prints * refactor + documentation * refactor * add stub runtime that links with symcc common runtime code * implement tracing runtime to generate message file * move ShMemCursor to libafl proper * qualify enum imports to make clippy happy * fix warnings * formatting * update symcc submodule to point to AFL++ org repo * fix naming of ShMemCursor and remove std requirement * ensure runtime is named correctly after compilation * add devcontainer files for easier development (will be removed later) * move rust nightly install into devcontainer.json this makes it run after the container has been built * dev container: install recommended packages * switch to building rust runtime from SymCC cmake * install corrosion in dev container for cmake-cargo integration * add smoke test for symcc-runtime integration * update symcc submodule * add rustfmt to devcontainer * properly mark the end of a constraint trace Using a special "End" message * small tool to dump constraints from a traced process * extend smoke test to include parsing & printing of constraints * update symcc submodule * first draft of expression filters for concolic * fix type in runtime method name * update symcc submodule * implement extensions to serdeany map: * remove -> Option<T> * insert_boxed(Box<T>) (avoids allocation if value is already boxed) * implement std::io::Seek for ShMemCursor * implement framing for in-memory traces this allows to efficiently get the length of trace. this is important for efficiently copying the trace out of the shared memory region. * fix for serdeany map * fuzzer that associates concolic traces with test case * ensure runtime can handle 0-expressions * move metadata, observer and feedback into separate files * convert executor to command executor and move to separate file * refactoring and streamlining * move panic mode configuration to cmake script * compile cmake from source, because debians version is too old......... * use separate stage for tracing * fix dockerfile * move runtime into the workspace using prior work on compilation flags from cmake * actually make use of selective symbolication filter * update to support latest symcc changes * implement hitmap for concolic runtime * clippy * implement selective symbolization and coverage map for dump_constraints tool * use concolic runtime coverage for concolic fuzzer feedback * actually kill process on timeout * be extra careful after killing process * increase command executor busy wait to 5ms * implement concolic tracing stage * address naming issue * implement floating point expression filter for runtime * rename expression filters to be less verbose * implement expression pruning * implement ConcolicMutationalStage * refactor command executor and remove busy loop * implement generic command executor * remove debug prints * refactor + documentation * refactor * fixed build, clippy * no_std * implement WithObservers executor as discussed * add symqemu as a submodule * fix symqemu submodule URL to be relative * update the concolic runtime to match the new interface * update the trace file header regularly to save constraints in case the program crashes * add build dependencies for symqemu * handle full mesage buffer properly * better policy for updating trace header * less aggregiously inefficient GC information serialization * move concolic runtime hitmap count to filter this is in preparation for the new runtime interface * very WIP new runtime interface * use more convenient types in rust runtime * EmptyRuntime -> NopRuntime * hide cpp_runtime and formatting * implement tracing runtime using new runtime interface * implement filters with new runtime interface * use a local checkout for symcc_runtime * make test runtime tracing * use test_runtime in smoke test * fix formatting * make the clippy overlord happy? * disable symcc build on everything but linux * make more of symcc_runtime linux only * fix linking symcc_runtime with C++ stdlib * will clippy ever be happy? * formatting * don't export symcc runtime when compiling tests * clippy... * "don't export symcc runtime when compiling tests" for runtime crate as well * clippy * move command executor to LibAFL * move concolic crate into LibAFL * move concolic{metada,observer} into LibAFL * move ConcolicFeedback into LibAFL * move ConolicStage into LibAFL * fix bug in symcc part of concolic runtime * stb_image fuzzer with concolic as example fuzzer * clean up basic_concolic_fuzzer * clean up and document concolic example fuzzer * formatting * clippy * remove basic_concolic_fuzzer (it is now part of the examples) * remove the runtime crate in favor of symcc_runtime * re-architect concolic smoke test and remove git submodules * remove old submodule directories * make coverage filter public * focker docker build * clippy * clippy fixes * fix ubuntu as well * remove .gitmodules * move concolic mutational stage into libafl behind feature flag * script to install dependencies for concolic smoke test * fix bug * clippy * add github action to run smoke test * fix action * ensure smoke test is run in correct directory * remove devcontainer files * address feedback * clippy * more clippy * address more feedback Co-authored-by: Dominik Maier <domenukk@gmail.com>
105 lines
3.5 KiB
Docker
105 lines
3.5 KiB
Docker
# syntax=docker/dockerfile:1.2
|
|
FROM rust:bullseye AS libafl
|
|
LABEL "maintainer"="afl++ team <afl@aflplus.plus>"
|
|
LABEL "about"="LibAFL Docker image"
|
|
|
|
# install sccache to cache subsequent builds of dependencies
|
|
RUN cargo install sccache
|
|
|
|
ENV HOME=/root
|
|
ENV SCCACHE_CACHE_SIZE="1G"
|
|
ENV SCCACHE_DIR=$HOME/.cache/sccache
|
|
ENV RUSTC_WRAPPER="/usr/local/cargo/bin/sccache"
|
|
ENV IS_DOCKER="1"
|
|
RUN sh -c 'echo set encoding=utf-8 > /root/.vimrc' \
|
|
echo "export PS1='"'[LibAFL \h] \w$(__git_ps1) \$ '"'" >> ~/.bashrc && \
|
|
mkdir ~/.cargo && \
|
|
echo "[build]\nrustc-wrapper = \"${RUSTC_WRAPPER}\"" >> ~/.cargo/config
|
|
|
|
RUN rustup component add rustfmt clippy
|
|
|
|
# Install clang 11, common build tools
|
|
RUN apt update && apt install -y build-essential gdb git wget clang clang-tools libc++-11-dev libc++abi-11-dev llvm
|
|
|
|
# Copy a dummy.rs and Cargo.toml first, so that dependencies are cached
|
|
WORKDIR /libafl
|
|
COPY Cargo.toml README.md ./
|
|
|
|
COPY libafl_derive/Cargo.toml libafl_derive/Cargo.toml
|
|
COPY scripts/dummy.rs libafl_derive/src/lib.rs
|
|
|
|
COPY libafl/Cargo.toml libafl/build.rs libafl/
|
|
COPY libafl/benches libafl/benches
|
|
COPY libafl/examples libafl/examples
|
|
COPY scripts/dummy.rs libafl/src/lib.rs
|
|
|
|
COPY libafl_frida/Cargo.toml libafl_frida/build.rs libafl_frida/
|
|
COPY scripts/dummy.rs libafl_frida/src/lib.rs
|
|
COPY libafl_frida/src/gettls.c libafl_frida/src/gettls.c
|
|
|
|
COPY libafl_qemu/Cargo.toml libafl_qemu/build.rs libafl_qemu/
|
|
COPY scripts/dummy.rs libafl_qemu/src/lib.rs
|
|
COPY libafl_qemu/src/weaks.c libafl_qemu/src/weaks.c
|
|
|
|
COPY libafl_sugar/Cargo.toml libafl_sugar/
|
|
COPY scripts/dummy.rs libafl_sugar/src/lib.rs
|
|
|
|
COPY libafl_cc/Cargo.toml libafl_cc/Cargo.toml
|
|
COPY scripts/dummy.rs libafl_cc/src/lib.rs
|
|
COPY libafl_cc/build.rs libafl_cc/build.rs
|
|
COPY libafl_cc/src/cmplog-routines-pass.cc libafl_cc/src/cmplog-routines-pass.cc
|
|
|
|
COPY libafl_targets/Cargo.toml libafl_targets/build.rs libafl_targets/
|
|
COPY libafl_targets/src libafl_targets/src
|
|
COPY scripts/dummy.rs libafl_targets/src/lib.rs
|
|
|
|
COPY libafl_tests/Cargo.toml libafl_tests/build.rs libafl_tests/
|
|
COPY scripts/dummy.rs libafl_tests/src/lib.rs
|
|
|
|
COPY libafl_concolic/test/dump_constraints/Cargo.toml libafl_concolic/test/dump_constraints/
|
|
COPY scripts/dummy.rs libafl_concolic/test/dump_constraints/src/lib.rs
|
|
|
|
COPY libafl_concolic/test/runtime_test/Cargo.toml libafl_concolic/test/runtime_test/
|
|
COPY scripts/dummy.rs libafl_concolic/test/runtime_test/src/lib.rs
|
|
|
|
COPY libafl_concolic/symcc_runtime/Cargo.toml libafl_concolic/symcc_runtime/build.rs libafl_concolic/symcc_runtime/
|
|
COPY scripts/dummy.rs libafl_concolic/symcc_runtime/src/lib.rs
|
|
|
|
RUN cargo build && cargo build --release
|
|
|
|
COPY scripts scripts
|
|
COPY docs docs
|
|
|
|
# Pre-build dependencies for a few common fuzzers
|
|
|
|
# Dep chain:
|
|
# libafl_cc (independent)
|
|
# libafl_derive -> libafl
|
|
# libafl_tests -> libafl
|
|
# libafl -> libafl_targets
|
|
# libafl_targets -> libafl_frida
|
|
|
|
# Build once without source
|
|
COPY libafl_cc/src libafl_cc/src
|
|
RUN touch libafl_cc/src/lib.rs
|
|
COPY libafl_derive/src libafl_derive/src
|
|
RUN touch libafl_derive/src/lib.rs
|
|
COPY libafl_tests/src libafl_tests/src
|
|
RUN touch libafl_tests/src/lib.rs
|
|
COPY libafl/src libafl/src
|
|
RUN touch libafl/src/lib.rs
|
|
COPY libafl_targets/src libafl_targets/src
|
|
RUN touch libafl_targets/src/lib.rs
|
|
COPY libafl_frida/src libafl_frida/src
|
|
RUN touch libafl_qemu/src/lib.rs
|
|
COPY libafl_qemu/src libafl_qemu/src
|
|
RUN touch libafl_frida/src/lib.rs
|
|
RUN cargo build && cargo build --release
|
|
|
|
# Copy fuzzers over
|
|
COPY fuzzers fuzzers
|
|
|
|
# RUN ./scripts/build_all_fuzzers.sh --no-fmt
|
|
|
|
ENTRYPOINT [ "/bin/bash" ]
|