Skip to content

Commit

Permalink
Migrate to "afl++" from "afl" (#766)
Browse files Browse the repository at this point in the history
* Migrate to "afl++" from "afl"

The original "afl" [1] has been abandoned and is not maintained since
2017. "afl++" [2] is its replacement. Since it's a fork, it has mostly
compatible command line, and more features.

[1]: http://lcamtuf.coredump.cx/afl/
[2]: https://github.com/AFLplusplus/AFLplusplus

The original afl is currently being phased out from distributions.
In particular, it's gone from whatever repo list GitHub Actions use,
breaking our build. Migrate to "afl++" instead.

Not all operating systems ship with "afl++" though. For example, it's
still not available in binary form on macOS via Homebrew. Therefore,
don't jump the gun and don't update the Makefile to use "afl++"-only
features. (However, it would be nice to use them if available.)

* Pin "fuzzing" job to Ubuntu 18.04

As noted in the comment, GitHub Actions runners are schizophrenic and
sometimes believe that they come from the future where the latest Ubuntu
image works correctly. Don't let them be fooled, use 18.04 for now.
  • Loading branch information
ilammy authored Jan 28, 2021
1 parent 68827da commit 0c6a44d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,14 @@ jobs:

fuzzing:
name: AFL fuzzing
runs-on: ubuntu-latest
# TODO(ilammy, 2021-01-28): use "ubuntu-latest" once it works
# Currently "ubuntu-latest" means "ubuntu-18.04" but for some inexplicable
# reasons GitHub runners in the main repo treat it as "ubuntu-20.04" which
# does not seem to work yet (for this job). Pin the Ubuntu 18.04 version
# for now, but don't forget to update this once "ubuntu-latest" changes
# its meaning or starts working for this job.
# See: https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners
runs-on: ubuntu-18.04
env:
FUZZ_TIMEOUT: 30s
THEMIS_DEFAULT_PBKDF2_ITERATIONS: 10
Expand All @@ -212,7 +219,7 @@ jobs:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install --yes gcc make zip \
afl gcc-multilib libc6-dev:i386 \
afl++ gcc-multilib libc6-dev:i386 \
libssl-dev:amd64 libssl-dev:i386
# AFL needs proper core dumps to be available, write them to files
sudo sh -c 'echo core > /proc/sys/kernel/core_pattern'
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ _Infrastructure:_
- Build system and tests now respect the `PATH` settings ([#685](https://github.com/cossacklabs/themis/pull/685)).
- Rename embedded BoringSSL symbols by default to avoid conflicts with system OpenSSL ([#702](https://github.com/cossacklabs/themis/pull/702)).
- Started phasing out CircleCI in favour of GitHub Actions ([#709](https://github.com/cossacklabs/themis/pull/709), [#755](https://github.com/cossacklabs/themis/pull/755)).
- Themis is now fuzzed with `afl++` ([#766](https://github.com/cossacklabs/themis/pull/766)).


## [0.13.6](https://github.com/cossacklabs/themis/releases/tag/0.13.6), November 23rd 2020
Expand Down
5 changes: 5 additions & 0 deletions tools/afl/fuzzy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
AFL_FUZZ ?= afl-fuzz
AFL_CC ?= afl-clang

# TODO(ilammy, 2021-01-27): use afl++ toolchain if available
# The above tools are compaible with the original "afl" which is currently
# not maintained. Modern systems come with "afl++" that has mostly compatible
# command-line and new instrumentation toolchain. We should use it if possible.

FUZZ_PATH = tools/afl
FUZZ_BIN_PATH = $(BIN_PATH)/afl
FUZZ_SRC_PATH = $(FUZZ_PATH)/src
Expand Down

0 comments on commit 0c6a44d

Please sign in to comment.